aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Component.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 11:39:45 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 11:39:45 +0100
commit455bb50a5007daf46b8719fff2a6292da6a294bf (patch)
treedbba8b1f9653a52bb7105f39323a11d85662c0fe /src/crepe/Component.h
parent3e94ecb3dac5003a3d58210ed1a4d1f1cb2083d1 (diff)
fix physics test
Diffstat (limited to 'src/crepe/Component.h')
-rw-r--r--src/crepe/Component.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/crepe/Component.h b/src/crepe/Component.h
index c6d72df..12c10cb 100644
--- a/src/crepe/Component.h
+++ b/src/crepe/Component.h
@@ -14,23 +14,20 @@ class ComponentManager;
*/
class Component {
public:
- struct Data {
- //! The ID of the GameObject this component belongs to
- const game_object_id_t id;
- //! The manager of this component
- ComponentManager & component_manager;
- };
+ //! 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:
/**
- * \param base Data
+ * \param id The id of the GameObject this component belongs to
*/
- Component(const Data & base);
+ Component(game_object_id_t id);
//! Only the ComponentManager can create components
- friend class crepe::ComponentManager;
+ friend class ComponentManager;
public:
- virtual ~Component() = default;
/**
* \brief Get the maximum number of instances for this component
*
@@ -41,11 +38,6 @@ public:
* \return The maximum number of instances for this component
*/
virtual int get_instances_max() const { return -1; }
-
-public:
- Data data;
- //! Whether the component is active
- bool active = true;
};
} // namespace crepe