|
Simple C++ Game
|
An entity in the game's component entity system. More...
#include <Entity.hpp>
Classes | |
| class | Component |
| A component of an entity in the game's component entity system. More... | |
Public Member Functions | |
| Entity () | |
| Construct a new Entity with a random ID. | |
| Entity (int id) | |
| Construct a new Entity object with a specific ID. More... | |
| int | getId () const |
| Get the ID of the Entity. More... | |
| void | add (const std::shared_ptr< Component > &component) |
| Adds the provided component to the entity. More... | |
| bool | hasComponent (const std::string id) const |
| Check if the Entity has a component of the specified type. More... | |
| std::shared_ptr< Component > | getComponent (const std::string id) const |
| Get the Component object. More... | |
An entity in the game's component entity system.
The Entity represents a collection of attributes, called Components, that together are acted upon by EntitySystem objects that form a complete game world.
| Entity::Entity | ( | int | id | ) |
| void Entity::add | ( | const std::shared_ptr< Component > & | component | ) |
| std::shared_ptr<Component> Entity::getComponent | ( | const std::string | id | ) | const |
| int Entity::getId | ( | ) | const |
Get the ID of the Entity.
| bool Entity::hasComponent | ( | const std::string | id | ) | const |