6 #include "engine/typedefs.h"
10 #include <unordered_map>
18 class StorageContainer;
122 virtual ComponentTypeId
135 bool m_isVolatile =
false;
137 EntityId m_owner = NULL_ENTITY;
169 #define COMPONENT(name) \
172 static const ComponentTypeId TYPE_ID; \
174 ComponentTypeId typeId() const override { \
178 static const std::string& TYPE_NAME() { \
179 static std::string string(#name); \
183 std::string typeName() const override { \
184 return TYPE_NAME(); \
virtual ComponentTypeId typeId() const =0
The component's type id.
virtual std::string typeName() const =0
The component's type name.
static luabind::scope luaBindings()
Lua bindings.
Definition: component.cpp:87
Base class for components.
Definition: component.h:31
EntityId owner() const
The entity this component belongs to.
Definition: component.h:80
Definition: bullet_to_ogre_system.h:5
Definition: bullet_ogre_conversion.h:6
virtual StorageContainer storage() const =0
Serializes the component.
Definition: component.cpp:127
void setOwner(EntityId owner)
Sets the component's owner.
Definition: component.h:105
virtual void load(const StorageContainer &storage)=0
Loads the component.
Definition: component.cpp:111
virtual ~Component()=0
Destructor.
Definition: component.cpp:101
bool isVolatile() const
A volatile component is not serialized during a save.
Definition: component.cpp:105
A key-value storage for serialization.
Definition: serialization.h:36
void setVolatile(bool isVolatile)
Sets the volatile flag.
Definition: component.cpp:119