aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Component.h
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-18 15:08:31 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-18 15:08:31 +0100
commitfee42c67918a9370f7f4e074dba9a677afccf90b (patch)
treec5ed200e3c584fafc4c6bd3df48adeed3cfbd31d /src/crepe/Component.h
parented1403aea4412bd479244eae8e2940190e71cd28 (diff)
parent121b64b1cb6cfead5814070c8b0185d3d7308095 (diff)
Merge remote-tracking branch 'origin/master' into niels/RenderingParticle
Diffstat (limited to 'src/crepe/Component.h')
-rw-r--r--src/crepe/Component.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/crepe/Component.h b/src/crepe/Component.h
index 0fe60b2..5279fb3 100644
--- a/src/crepe/Component.h
+++ b/src/crepe/Component.h
@@ -2,8 +2,6 @@
#include "types.h"
-#include <cstdint>
-
namespace crepe {
class ComponentManager;
@@ -11,36 +9,37 @@ 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.
+ * This class is the base class for all components. It provides a common interface for all
+ * components.
*/
class Component {
+public:
+ //! Whether the component is active
+ bool active = true;
+ //! The id of the GameObject this component belongs to
+ const game_object_id_t game_object_id;
+
protected:
- //! Only the ComponentManager can create components
- friend class crepe::ComponentManager;
/**
* \param id The id of the GameObject this component belongs to
*/
Component(game_object_id_t id);
+ //! Only the ComponentManager can create components
+ friend class ComponentManager;
public:
virtual ~Component() = default;
+
+public:
/**
* \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.
+ * 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
- const game_object_id_t game_object_id;
- //! Whether the component is active
- bool active = true;
};
} // namespace crepe