aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/ComponentManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/ComponentManager.h')
-rw-r--r--src/crepe/ComponentManager.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/crepe/ComponentManager.h b/src/crepe/ComponentManager.h
index ca2e7c6..a14cb46 100644
--- a/src/crepe/ComponentManager.h
+++ b/src/crepe/ComponentManager.h
@@ -17,8 +17,7 @@ class GameObject;
/**
* \brief Manages all components
*
- * This class manages all components. It provides methods to add, delete and get
- * components.
+ * This class manages all components. It provides methods to add, delete and get components.
*/
class ComponentManager {
public:
@@ -29,8 +28,8 @@ protected:
/**
* \brief Add a component to the ComponentManager
*
- * This method adds a component to the ComponentManager. The component is
- * created with the given arguments and added to the ComponentManager.
+ * This method adds a component to the ComponentManager. The component is created with the
+ * given arguments and added to the ComponentManager.
*
* \tparam T The type of the component
* \tparam Args The types of the arguments
@@ -88,8 +87,7 @@ public:
* \return A vector of all components of the specific type and id
*/
template <typename T>
- std::vector<std::reference_wrapper<T>>
- get_components_by_id(game_object_id_t id) const;
+ std::vector<std::reference_wrapper<T>> get_components_by_id(game_object_id_t id) const;
/**
* \brief Get all components of a specific type
*
@@ -111,16 +109,14 @@ private:
/**
* \brief The components
*
- * This unordered_map stores all components. The key is the type of the
- * component and the value is a vector of vectors of unique pointers to the
- * components.
- * Every component type has its own vector of vectors of unique pointers to
- * the components. The first vector is for the ids of the GameObjects and the
- * second vector is for the components (because a GameObject might have multiple
- * components).
+ * This unordered_map stores all components. The key is the type of the component and the
+ * value is a vector of vectors of unique pointers to the components.
+ *
+ * Every component type has its own vector of vectors of unique pointers to the components.
+ * The first vector is for the ids of the GameObjects and the second vector is for the
+ * components (because a GameObject might have multiple components).
*/
- std::unordered_map<std::type_index,
- std::vector<std::vector<std::unique_ptr<Component>>>>
+ std::unordered_map<std::type_index, std::vector<std::vector<std::unique_ptr<Component>>>>
components;
//! ID of next GameObject