#pragma once #include #include #include namespace yage { /** * The component mask represents all the components that the entity is * currently attached to. */ typedef std::bitset<64> ComponentMask; typedef unsigned int GroupId; class BaseComponent { protected: virtual GroupId getGroup() = 0; static GroupId group_id_counter_; private: friend class EntityManager; }; template class Component : public BaseComponent { GroupId getGroup() override; }; class ComponentGroup { public: std::vector> components_; }; template GroupId Component::getGroup() { static GroupId group_id = group_id_counter_++; return group_id; } } // namespace yage