aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Component.h
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-10 13:40:42 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-10 13:40:42 +0100
commitd80c98ee03e59e0c38e025a7fe83ab4c39115fb8 (patch)
treec31c861b82d384e64071b4e7f64dfafe99b888c0 /src/crepe/Component.h
parentb2c72ee8ce282bb13b0fbeb2ddb01fdfd6ad1280 (diff)
parent7a8657dfe019104aced61a5b63e63f61ad919f7a (diff)
font progress
Diffstat (limited to 'src/crepe/Component.h')
-rw-r--r--src/crepe/Component.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/crepe/Component.h b/src/crepe/Component.h
index c30419d..060ff00 100644
--- a/src/crepe/Component.h
+++ b/src/crepe/Component.h
@@ -16,7 +16,12 @@ class Component {
public:
//! Whether the component is active
bool active = true;
- //! The id of the GameObject this component belongs to
+ /**
+ * \brief The id of the GameObject this component belongs to
+ *
+ * \note Only systems are supposed to use this member, but since friend
+ * relations aren't inherited this needs to be public.
+ */
const game_object_id_t game_object_id;
protected:
@@ -24,7 +29,7 @@ protected:
* \param id The id of the GameObject this component belongs to
*/
Component(game_object_id_t id);
- //! Only the ComponentManager can create components
+ //! Only ComponentManager can create components
friend class ComponentManager;
Component(const Component &) = delete;
@@ -45,6 +50,8 @@ public:
* \return The maximum number of instances for this component
*/
virtual int get_instances_max() const { return -1; }
+ //! Only ComponentManager needs to know the max instance count
+ friend class ComponentManager;
};
} // namespace crepe