// // Created by Daniu // #ifndef EU07_SYSTEMMANAGER_H #define EU07_SYSTEMMANAGER_H #pragma once #include "BaseSystem.h" #include #include class ECWorld; class SystemManager { public: SystemManager() = default; ~SystemManager(); template T& AddSystem(Args&&... args) { static_assert(std::is_base_of_v); auto system = std::make_unique(std::forward(args)...); T& ref = *system; m_systems.emplace_back(std::move(system)); return ref; } void Create(ECWorld& world); void Destroy(ECWorld& world); void Update(ECWorld& world, float dt); void Render(ECWorld& world); private: std::vector> m_systems; }; #endif //EU07_SYSTEMMANAGER_H