Manages systems and the stages associated with them.
More...
#include <system.hpp>
|
| template<typename T> |
| std::shared_ptr< T > | RegisterSystem (std::string stage) |
| | Registers a system.
|
| template<typename T> |
| void | SetSignature (Signature signature) |
| | Sets a systems signature.
|
| void | EntityDespawned (Entity entity) |
| | Called when an entity is despawned.
|
| SystemStageID | GetOrCreateStage (const std::string &name) |
| | Gets a StageID by name, or creates one if it doesnt exist.
|
| SystemStageID | GetStageOrFail (const std::string &name) |
| | Gets a StageID by name.
|
| void | StageBefore (std::string name, std::string after) |
| | Creates a stage before another.
|
| void | StageAfter (std::string name, std::string before) |
| | Creates a stage before another.
|
|
void | PopulateStages () |
| | Clears and populates ordereredStages.
|
| void | EntitySignatureChanged (Entity entity, Signature signature) |
| | Updates the system signature based on the entities new signature.
|
|
|
std::unordered_map< std::string, SystemStageID > | nameToID |
| | Maps a stage name to its respective ID.
|
|
std::unordered_map< SystemStageID, std::vector< SystemStageID > > | edges |
| | How a stage is associated with one another.
|
|
std::vector< SystemStage > | stages |
| | A list of registered stages.
|
|
std::vector< SystemStageID > | orderedStages |
| | Stages put in order by PopulateStages.
|
|
std::unordered_map< SystemStageID, std::vector< std::shared_ptr< System > > > | stageSystems |
|
std::unordered_map< std::string, std::shared_ptr< System > > | systems |
| | A map of systems and their name.
|
|
std::unordered_map< std::string, Signature > | signatures |
| | A map of systems name and the signature associated with them.
|
|
SystemStageID | counter |
|
bool | per_entity = true |
Manages systems and the stages associated with them.
◆ EntityDespawned()
| void SystemManager::EntityDespawned |
( |
Entity | entity | ) |
|
Called when an entity is despawned.
Removes the entity from the entity list that applied to the system
- Parameters
-
| entity | The entity that was despawned |
◆ EntitySignatureChanged()
| void SystemManager::EntitySignatureChanged |
( |
Entity | entity, |
|
|
Signature | signature ) |
Updates the system signature based on the entities new signature.
- Parameters
-
| entity | The entities whom system was changed |
| signature | The new signature of the entity |
◆ GetOrCreateStage()
| SystemStageID SystemManager::GetOrCreateStage |
( |
const std::string & | name | ) |
|
Gets a StageID by name, or creates one if it doesnt exist.
- Parameters
-
| name | The name of the stage to create or get |
- Returns
- The ID created or of an existing stage
◆ GetStageOrFail()
| SystemStageID SystemManager::GetStageOrFail |
( |
const std::string & | name | ) |
|
Gets a StageID by name.
- Parameters
-
| name | The name of the stage to get |
- Exceptions
-
| Runtime | Error if the stage doesnt exist |
- Returns
- The ID created
◆ RegisterSystem()
template<typename T>
| std::shared_ptr< T > acheron::ecs::SystemManager::RegisterSystem |
( |
std::string | stage | ) |
|
|
inline |
Registers a system.
Registers a system to its appropriate stage, and type
- Template Parameters
-
| T | The struct that should inherit from System |
- Parameters
-
| stage | The stage at which the system should be executed |
- Returns
- A pointer to the system registered(usually ignored)
- Exceptions
-
| Assertion | Fail if T doesnt inherit system, or if already registered |
◆ SetSignature()
template<typename T>
| void acheron::ecs::SystemManager::SetSignature |
( |
Signature | signature | ) |
|
|
inline |
Sets a systems signature.
- Template Parameters
-
| T | The struct that should inherit from System |
- Parameters
-
| signature | The system signature to apply to T |
◆ StageAfter()
| void SystemManager::StageAfter |
( |
std::string | name, |
|
|
std::string | before ) |
Creates a stage before another.
- Parameters
-
| name | The name of the system to register after |
| after | The system that will be before the registered stage |
◆ StageBefore()
| void SystemManager::StageBefore |
( |
std::string | name, |
|
|
std::string | after ) |
Creates a stage before another.
- Parameters
-
| name | The name of the system to register before |
| after | The system that will be after the registered stage |
The documentation for this class was generated from the following files: