3 #include "engine/component.h"
4 #include "engine/typedefs.h"
104 const std::string& name,
156 std::unique_ptr<Component> component
185 ComponentTypeId typeId
204 ComponentTypeId typeId
259 const std::string& name
276 ComponentTypeId typeId
307 struct Implementation;
308 std::unique_ptr<Implementation> m_impl;
void setVolatile(bool isVolatile)
Sets the volatile flag.
Definition: entity.cpp:217
void addChild(Entity &child)
Adds a child to the current entity.
Definition: entity.cpp:224
EntityId id() const
The entity's id.
Definition: entity.cpp:188
Component * getComponent(ComponentTypeId typeId)
Retrieves a component by type id.
Definition: entity.cpp:165
bool exists() const
Checks if the entity has any components.
Definition: entity.cpp:159
Entity & operator=(const Entity &other)
Copy assignment.
Definition: entity.cpp:130
bool hasChildren() const
Returns whether the entity has any children.
Definition: entity.cpp:231
Convenience class to handle an entity.
Definition: entity.h:28
void stealName(const std::string &name)
Rebinds the name to the new Id.
Definition: entity.cpp:236
void destroy()
Removes all components of this entity.
Definition: entity.cpp:153
Entity(GameState *gameState=nullptr)
Constructor.
Definition: entity.cpp:84
Base class for components.
Definition: component.h:31
~Entity()
Destructor.
Definition: entity.cpp:115
bool isVolatile() const
Returns the volatile flag.
Definition: entity.cpp:194
bool operator==(const Entity &other) const
Compares two entities.
Definition: entity.cpp:119
bool hasComponent(ComponentTypeId typeId)
Checks whether this entity has a component.
Definition: entity.cpp:176
Entity transfer(GameState *newGameState)
Transfers an entity to a different gameState.
Definition: entity.cpp:210
Definition: bullet_to_ogre_system.h:5
void addComponent(std::unique_ptr< Component > component)
Adds a component to this entity.
Definition: entity.cpp:142
Definition: bullet_ogre_conversion.h:6
static luabind::scope luaBindings()
Lua bindings.
Definition: entity.cpp:44
Represents a distinct set of active systems and entities.
Definition: game_state.h:41
void removeComponent(ComponentTypeId typeId)
Removes a component by type id.
Definition: entity.cpp:200