diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-14 20:27:05 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-14 20:27:05 +0100 |
commit | d258fcc8efdb6a968a220c4590a204292a16ad42 (patch) | |
tree | bb37f3d00f42b15a38e07f8ae0ba7fe2641cf7e3 /src/crepe/Component.h | |
parent | add8724446fdeae1aaec9b07544cf7a5475a9bfe (diff) |
added thoughtsloek/audio
Diffstat (limited to 'src/crepe/Component.h')
-rw-r--r-- | src/crepe/Component.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/crepe/Component.h b/src/crepe/Component.h index 12c10cb..7734335 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,10 +29,9 @@ 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; -public: /** * \brief Get the maximum number of instances for this component * @@ -38,6 +42,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 |