Adding a movable system/component

This commit is contained in:
Zoe Roux
2021-05-17 17:03:15 +02:00
parent 7313a9d4e0
commit 76ccd80df7
13 changed files with 157 additions and 41 deletions

View File

@@ -17,17 +17,17 @@ namespace WAL
System(System &&) = default;
//! @brief Get the name of the component corresponding to this system.
virtual std::type_info &getComponent() const = 0;
virtual const std::type_info &getComponent() const = 0;
//! @brief Update the corresponding component of the given entity
//! @param entity The entity to update.
//! @param dtime The delta time.
virtual void onUpdate(Entity &entity, std::chrono::nanoseconds dtime) = 0;
virtual void onUpdate(Entity &entity, std::chrono::nanoseconds dtime);
//! @brief An alternative of onUpdate that is called every 8ms (120 times per seconds). If the system slow down, it will try to catch up.
//! @remark This should be used for Physics, AI and everything that could be imprecise due to float rounding.
//! @param entity The entity to update.
virtual void onFixedUpdate(Entity &entity) = 0;
virtual void onFixedUpdate(Entity &entity);
protected:
//! @brief A system can't be instantiated, it should be derived.
System() = default;