aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Component.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 16:26:38 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 16:26:38 +0100
commitb63f4700f7bda696afb14cc3111be0f8b0eed458 (patch)
tree08c4b00b249a4fa672d97a5bc79927adac0a0257 /src/crepe/Component.h
parent2933655dea64f11f200f42fe51e58dacc5f160eb (diff)
parent9e87a556a5f68c5f9bb04bef9a66880536ccd6e8 (diff)
merge `loek/tests` into `loek/cleanup` (close #32)
Diffstat (limited to 'src/crepe/Component.h')
-rw-r--r--src/crepe/Component.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/crepe/Component.h b/src/crepe/Component.h
index 0fe60b2..12c10cb 100644
--- a/src/crepe/Component.h
+++ b/src/crepe/Component.h
@@ -2,8 +2,6 @@
#include "types.h"
-#include <cstdint>
-
namespace crepe {
class ComponentManager;
@@ -15,16 +13,21 @@ class ComponentManager;
* 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;
/**
* \brief Get the maximum number of instances for this component
*
@@ -35,12 +38,6 @@ public:
* \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