entity_system class.
#include <entity_system.h>
ophidian::entity_system::entity_system::entity_system |
( |
| ) |
|
|
inline |
Default constructor. Creates an empty vector of entities.
ophidian::entity_system::entity_system::entity_system |
( |
std::size_t |
qnt | ) |
|
|
inline |
Non-default constructor. It preallocates a given quantity of entities to be stored in the future.
- Parameters
-
qnt | quantity to be allocated. |
entities_storage::const_iterator ophidian::entity_system::entity_system::begin |
( |
| ) |
const |
|
inline |
Returns an iterator pointing to the beginning of the entities in the system. The iterator can be used to iterate through the entities.
- Returns
- Iterator pointing to the beginning of the entities in the system.
entity ophidian::entity_system::entity_system::create |
( |
| ) |
|
Creates a new entity and add it to the system. If there are properties associtated to the system they are notified that a new entity has been created.
- Returns
- The created entity.
void ophidian::entity_system::entity_system::destroy |
( |
entity |
e | ) |
|
Destroys a entity from the system. If there are properties associtated to the system they are notified that an entity has been destroyed.
- Parameters
-
bool ophidian::entity_system::entity_system::empty |
( |
| ) |
const |
|
inline |
Returns if the system is empty or not. An empty system do not have entities belonging to it.
- Returns
- true if the system is empty, false otherwise.
entities_storage::const_iterator ophidian::entity_system::entity_system::end |
( |
| ) |
const |
|
inline |
Returns an interator pointing to the end of the entities in the system.
- Returns
- Iterator pointing to the end of the entities in the system.
const entities_storage& ophidian::entity_system::entity_system::entities |
( |
| ) |
const |
|
inline |
Getter of entities vector.
- Returns
- A constant reference to the vector containing all entities in the system.
entity_index ophidian::entity_system::entity_system::lookup |
( |
entity |
e | ) |
const |
|
inline |
Gets the index of an entity, which can be used to acess its properties.
- Parameters
-
- Returns
- Index of the entity.
void ophidian::entity_system::entity_system::preallocate |
( |
std::size_t |
qnt | ) |
|
This method preallocate a given quantity of entities to be stored in the future. It also notifies every property to increase its size.
- Parameters
-
qnt | quantity to be allocated. |
void ophidian::entity_system::entity_system::register_property |
( |
property * |
property | ) |
|
Registers a new property in the system. If there are already entities created in the system the property is notified to create values to them.
- Parameters
-
p | Pointer to the new property. |
std::size_t ophidian::entity_system::entity_system::size |
( |
| ) |
const |
|
inline |
Returns the number of entities as the size of the system.
- Returns
- Number of entities in the system.
The documentation for this class was generated from the following files:
- /home/csguth/workspace/openeda/src/entity_system/entity_system.h
- /home/csguth/workspace/openeda/src/entity_system/entity_system.cpp