diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-16 21:45:36 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-16 21:45:36 +0100 |
commit | 73598a9e7f49047d74ca439cb0f300099d8c03bf (patch) | |
tree | ef62148ac6769f169670a1e7f7fd8482045ef65f /src/crepe/api/LoopManager.h | |
parent | d258fcc8efdb6a968a220c4590a204292a16ad42 (diff) | |
parent | 121b64b1cb6cfead5814070c8b0185d3d7308095 (diff) |
merge `master` into `loek/audio`
Diffstat (limited to 'src/crepe/api/LoopManager.h')
-rw-r--r-- | src/crepe/api/LoopManager.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/crepe/api/LoopManager.h b/src/crepe/api/LoopManager.h index 288dca2..f6904be 100644 --- a/src/crepe/api/LoopManager.h +++ b/src/crepe/api/LoopManager.h @@ -68,18 +68,32 @@ private: bool game_running = false; -protected: - ComponentManager & get_component_manager(); - template <class T> - T & get_system(); - private: + //! Component manager instance ComponentManager component_manager{}; - std::unordered_map<std::type_index, std::unique_ptr<System>> systems; private: + /** + * \brief Collection of System instances + * + * This map holds System instances indexed by the system's class typeid. It is filled in the + * constructor of \c LoopManager using LoopManager::load_system. + */ + std::unordered_map<std::type_index, std::unique_ptr<System>> systems; + /** + * \brief Initialize a system + * \tparam T System type (must be derivative of \c System) + */ template <class T> void load_system(); + /** + * \brief Retrieve a reference to ECS system + * \tparam T System type + * \returns Reference to system instance + * \throws std::runtime_error if the System is not initialized + */ + template <class T> + T & get_system(); }; } // namespace crepe |