Robot Devastation
|
Class implementing a finite state machine.
#include <StateMachine.hpp>
Public Member Functions | |
FiniteStateMachine (const std::vector< StateDirector * > &stateDirectors, int initial_state_id) | |
Creates a FiniteStateMachine from the states that form it. More... | |
bool | start () |
Starts the state machine (running the initial state) | |
bool | stop () |
int | getCurrentState () const |
Returns current active state id. | |
Private Attributes | |
std::vector< StateDirector * > | stateDirectors |
int | initial_state_id |
rd::FiniteStateMachine::FiniteStateMachine | ( | const std::vector< StateDirector * > & | stateDirectors, |
int | initial_state_id | ||
) |
stateDirectors | vector of StateDirector forming the FiniteStateMachine |
initial_state_id | Id of the initial state |