aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Component.h
diff options
context:
space:
mode:
authormax-001 <maxsmits21@kpnmail.nl>2024-11-06 14:03:34 +0100
committermax-001 <maxsmits21@kpnmail.nl>2024-11-06 14:03:34 +0100
commitdb5a3668aa4b3919ee8dce7ed0872aa5707f80ff (patch)
tree6169d98300a2b26d84a85961a66e222a2ca2e5ca /src/crepe/Component.h
parent64ca0a7ae147c7d98ff092e04d86468ace6ea2a1 (diff)
Added Doxygen comments
Diffstat (limited to 'src/crepe/Component.h')
-rw-r--r--src/crepe/Component.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/crepe/Component.h b/src/crepe/Component.h
index 40e6f49..02a4e7e 100644
--- a/src/crepe/Component.h
+++ b/src/crepe/Component.h
@@ -6,17 +6,38 @@ namespace crepe {
class ComponentManager;
+/**
+ * \brief Base class for all components
+ *
+ * This class is the base class for all components. It provides a common
+ * interface for all components.
+ */
class Component {
protected:
+ //! Only the ComponentManager can create components
friend class crepe::ComponentManager;
+ /**
+ * \param id The id of the GameObject this component belongs to
+ */
Component(uint32_t id);
public:
virtual ~Component() = default;
+ /**
+ * \brief Get the maximum number of instances for this component
+ *
+ * This method returns -1 by default, which means that there is no limit
+ * for the number of instances. Concrete components can override this method
+ * to set a limit.
+ *
+ * \return The maximum number of instances for this component
+ */
virtual int get_instances_max() const { return -1; }
public:
+ //! The id of the GameObject this component belongs to
uint32_t game_object_id;
+ //! Whether the component is active
bool active = true;
};