Hymn to Beauty
C++ 3D Engine
SuperComponent.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <json/json.h>
4
5class Entity;
6
7namespace Component {
10 public:
13
15 virtual ~SuperComponent();
16
18 void Kill();
19
21
24 bool IsKilled() const;
25
27
31 virtual void Serialize(Json::Value& node, bool load) = 0;
32
34 Entity* entity = nullptr;
35
36 private:
37 bool killed = false;
38};
39} // namespace Component
Component which all components inherit.
Definition: SuperComponent.hpp:9
bool IsKilled() const
Get whether component has been killed.
Definition: SuperComponent.cpp:13
Entity * entity
Pointer to which entity this component corresponds.
Definition: SuperComponent.hpp:34
virtual ~SuperComponent()
Destructor.
Definition: SuperComponent.cpp:7
SuperComponent()
Create new SuperComponent.
Definition: SuperComponent.cpp:5
virtual void Serialize(Json::Value &node, bool load)=0
Save or load component values to/from JSON.
void Kill()
Kill the component, will be removed at the end of the frame.
Definition: SuperComponent.cpp:9
Entity containing various components.
Definition: Entity.hpp:16
Definition: BoxShapeEditor.hpp:5