Reworking dependencies

This commit is contained in:
Zoe Roux
2021-05-21 16:51:18 +02:00
parent dee56a52c7
commit e5d3823d0c
12 changed files with 53 additions and 35 deletions

View File

@@ -12,6 +12,9 @@ namespace WAL
//! @brief A base system of WAL
class System
{
private:
//! @brief The list of dependencies of this system
std::vector<std::type_index> _dependencies = {};
public:
//! @brief A virtual, default, destructor
virtual ~System() = default;
@@ -19,8 +22,8 @@ namespace WAL
System(System &&) = default;
//! @brief Get the name of the component corresponding to this system.
virtual const std::type_info &getComponent() const = 0;
const std::vector<std::type_index> &getDependencies() const;
//! @brief Update the corresponding component of the given entity
//! @param entity The entity to update.
//! @param dtime The delta time.
@@ -35,7 +38,7 @@ namespace WAL
virtual void onSelfUpdate();
protected:
//! @brief A system can't be instantiated, it should be derived.
System() = default;
explicit System(std::vector<std::type_index> dependencies);
//! @brief A system can't be instantiated, it should be derived.
System(const System &) = default;
//! @brief A system can't be instantiated, it should be derived.