10 #include <Nazara/Core/Bitset.hpp> 11 #include <Nazara/Core/HandledObject.hpp> 12 #include <Nazara/Core/Signal.hpp> 13 #include <NDK/Algorithm.hpp> 14 #include <NDK/Prerequesites.hpp> 28 class NDK_API
Entity :
public Nz::HandledObject<Entity>
39 BaseComponent& AddComponent(std::unique_ptr<BaseComponent>&& component);
40 template<
typename ComponentType,
typename... Args> ComponentType& AddComponent(Args&&... args);
44 inline void Enable(
bool enable =
true);
47 template<
typename ComponentType> ComponentType& GetComponent();
48 inline const BaseComponent& GetComponent(ComponentIndex index)
const;
49 template<
typename ComponentType>
const ComponentType& GetComponent()
const;
51 inline EntityId GetId()
const;
53 inline World* GetWorld()
const;
55 inline bool HasComponent(ComponentIndex index)
const;
56 template<
typename ComponentType>
bool HasComponent()
const;
61 inline bool IsEnabled()
const;
62 inline bool IsValid()
const;
64 inline void RemoveAllComponents();
65 inline void RemoveComponent(ComponentIndex index);
66 template<
typename ComponentType>
void RemoveComponent();
73 NazaraSignal(OnEntityDestruction,
Entity* );
81 void DestroyComponent(ComponentIndex index);
85 inline void RegisterEntityList(
EntityList* list);
86 inline void RegisterSystem(SystemIndex index);
88 inline void SetWorld(
World* world) noexcept;
90 inline void UnregisterEntityList(
EntityList* list);
91 inline void UnregisterSystem(SystemIndex index);
93 std::vector<std::unique_ptr<BaseComponent>> m_components;
94 std::vector<EntityList*> m_containedInLists;
105 #include <NDK/Entity.inl> 107 #endif // NDK_ENTITY_HPP TODO: For now is unable to display different color in the history, it needs a RichTextDrawer to do so...
Definition: Algorithm.hpp:12
NDK class that represents an entity in a world.
Definition: Entity.hpp:28
Core class that represents a string.
Definition: String.hpp:22
NDK class that represents the common base of all systems.
Definition: BaseSystem.hpp:17
NDK class that represents a set of entities to help performing batch operations.
Definition: EntityList.hpp:16
NDK class that represents a world.
Definition: World.hpp:25
Core class that represents a set of bits.
Definition: Bitset.hpp:22
NDK class that represents the common base of all components.
Definition: BaseComponent.hpp:17