Atoms Crowd  4.1.0
Atoms::StateMachines Class Reference

Container for all state machines. More...

#include <StateMachines.h>

Public Member Functions

AtomsPtr< StateMachinestateMachine (const std::string &typeName)
 Gets a state machine by name. More...
 
void addStateMachine (const std::string &name, const StateMachine &stateMachine, bool replace=true)
 Add a state machine to the map. More...
 
void removeStateMachine (const std::string &name)
 Removes a state machine from the map. More...
 
std::vector< std::string > stateMachineNames ()
 Gets all state machines names. More...
 
bool stateMachineExists (const std::string &name)
 Checks if a state machine exists. More...
 
unsigned int numStateMachines ()
 Gets the number fo state machines.
 
void clear ()
 Removes all state machines.
 
void registerLoaderCallback (std::function< StateMachine(const char *)> &callback)
 

Static Public Member Functions

static StateMachinesinstance ()
 Singleton access.
 

Detailed Description

Container for all state machines.

Member Function Documentation

◆ addStateMachine()

void Atoms::StateMachines::addStateMachine ( const std::string &  name,
const StateMachine stateMachine,
bool  replace = true 
)

Add a state machine to the map.

Parameters
namestate machine name
stateMachinestate machine

◆ removeStateMachine()

void Atoms::StateMachines::removeStateMachine ( const std::string &  name)

Removes a state machine from the map.

Parameters
namestate machine name

◆ stateMachine()

AtomsPtr<StateMachine> Atoms::StateMachines::stateMachine ( const std::string &  typeName)

Gets a state machine by name.

Parameters
typeNamestate machine name
Returns
Pointer to the state machine stored inside this class

◆ stateMachineExists()

bool Atoms::StateMachines::stateMachineExists ( const std::string &  name)

Checks if a state machine exists.

Parameters
namestate machine name
Returns
Return true if the state machine exists

◆ stateMachineNames()

std::vector<std::string> Atoms::StateMachines::stateMachineNames ( )

Gets all state machines names.

Returns
List of all state machines

The documentation for this class was generated from the following file: