Manages the entities in an array using bitwise operations to know if it has components.
More...
#include <entity.h>
|
|
| EntityManager (std::size_t reservedSize) |
| |
| Entity | CreateEntity () |
| | CreateEntity is a method that will return the next available Entity index. It will look at the internal entityMasks_ array and give the first one that is free to use. If none are free, the array is reallocated. More...
|
| |
| void | DestroyEntity (Entity entity) |
| | DestroyEntity is a method that will erase all Component from the EntityMask. It means that EntityExists will be false and that HasComponent will always return false. It will not do anything to the actual ComponentManager. More...
|
| |
| void | AddComponent (Entity entity, EntityMask mask) |
| | AddComponent is a method that adds the bitwise entity mask to the entity mask. It is normally called by the ComponentManager. More...
|
| |
| void | RemoveComponent (Entity entity, EntityMask mask) |
| | RemoveComponent is a method that removes the bitwise entity mask to the entity mask. More...
|
| |
| bool | HasComponent (Entity entity, EntityMask mask) const |
| | HasComponent is a method that check if a certain Entity has a EntityMask on. More...
|
| |
| bool | EntityExists (Entity entity) const |
| | EntityExists is a method that check if a certain Entity has any Component and thus do exist. More...
|
| |
| std::size_t | GetEntitiesSize () const |
| | GetEntitiesSize is a method that returns the size of the EntityMask array. More...
|
| |
Manages the entities in an array using bitwise operations to know if it has components.
◆ AddComponent()
AddComponent is a method that adds the bitwise entity mask to the entity mask. It is normally called by the ComponentManager.
- Parameters
-
| entity | is the entity to add the new EntityMask |
| mask | is the Component bitwise mask to be added to the Entity |
◆ CreateEntity()
| Entity core::EntityManager::CreateEntity |
( |
| ) |
|
CreateEntity is a method that will return the next available Entity index. It will look at the internal entityMasks_ array and give the first one that is free to use. If none are free, the array is reallocated.
- Returns
- the newly created Entity
◆ DestroyEntity()
| void core::EntityManager::DestroyEntity |
( |
Entity |
entity | ) |
|
DestroyEntity is a method that will erase all Component from the EntityMask. It means that EntityExists will be false and that HasComponent will always return false. It will not do anything to the actual ComponentManager.
- Parameters
-
| entity | is the mask that will be voided |
◆ EntityExists()
| bool core::EntityManager::EntityExists |
( |
Entity |
entity | ) |
const |
EntityExists is a method that check if a certain Entity has any Component and thus do exist.
- Parameters
-
| entity | is the Entity that we check |
- Returns
- the statement result if an Entity exists
◆ GetEntitiesSize()
| std::size_t core::EntityManager::GetEntitiesSize |
( |
| ) |
const |
GetEntitiesSize is a method that returns the size of the EntityMask array.
- Returns
- the total size of the EntityMask array.
◆ HasComponent()
HasComponent is a method that check if a certain Entity has a EntityMask on.
- Parameters
-
| entity | is the Entity that we check |
| mask | is the Component bitwise mask to check. |
- Returns
- the statement result if an Entity has a certain bitwise mask on.
◆ RemoveComponent()
RemoveComponent is a method that removes the bitwise entity mask to the entity mask.
- Parameters
-
| entity | is the entity to remove the EntityMask |
| mask | is the Component bitwise mask to be removed to the Entity |
The documentation for this class was generated from the following files:
- G:/Development/SAE/921/GPR5100_Rollback/core/include/engine/entity.h
- G:/Development/SAE/921/GPR5100_Rollback/core/src/engine/entity.cpp