diff options
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 |