7 #ifndef NDK_BASESYSTEM_HPP 8 #define NDK_BASESYSTEM_HPP 10 #include <Nazara/Core/Bitset.hpp> 11 #include <NDK/EntityList.hpp> 29 inline void Enable(
bool enable =
true);
31 bool Filters(
const Entity* entity)
const;
34 inline float GetFixedUpdateRate()
const;
35 inline SystemIndex GetIndex()
const;
36 inline float GetMaximumUpdateRate()
const;
37 inline int GetUpdateOrder()
const;
38 inline World& GetWorld()
const;
40 inline bool IsEnabled()
const;
42 inline bool HasEntity(
const Entity* entity)
const;
44 inline void SetFixedUpdateRate(
float updatePerSecond);
45 inline void SetMaximumUpdateRate(
float updatePerSecond);
46 void SetUpdateOrder(
int updateOrder);
48 inline void Update(
float elapsedTime);
54 template<
typename ComponentType>
void Excludes();
55 template<
typename ComponentType1,
typename ComponentType2,
typename... Rest>
void Excludes();
56 inline void ExcludesComponent(ComponentIndex index);
58 static SystemIndex GetNextIndex();
60 template<
typename ComponentType>
void Requires();
61 template<
typename ComponentType1,
typename ComponentType2,
typename... Rest>
void Requires();
62 inline void RequiresComponent(ComponentIndex index);
64 template<
typename ComponentType>
void RequiresAny();
65 template<
typename ComponentType1,
typename ComponentType2,
typename... Rest>
void RequiresAny();
66 inline void RequiresAnyComponent(ComponentIndex index);
68 virtual void OnUpdate(
float elapsedTime) = 0;
71 inline void AddEntity(Entity* entity);
73 virtual void OnEntityAdded(Entity* entity);
74 virtual void OnEntityRemoved(Entity* entity);
75 virtual void OnEntityValidation(Entity* entity,
bool justAdded);
77 inline void RemoveEntity(Entity* entity);
79 inline void SetWorld(
World* world) noexcept;
81 inline void ValidateEntity(Entity* entity,
bool justAdded);
83 static inline bool Initialize();
84 static inline void Uninitialize();
91 SystemIndex m_systemIndex;
94 float m_fixedUpdateRate;
95 float m_maxUpdateRate;
96 float m_updateCounter;
99 static SystemIndex s_nextIndex;
103 #include <NDK/BaseSystem.inl> 105 #endif // NDK_BASESYSTEM_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
NDK class that represents the software development kit, a set of tools made to ease the conception of...
Definition: Sdk.hpp:14
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