5 #ifndef __RD_STATE_MACHINE_BUILDER_HPP__
6 #define __RD_STATE_MACHINE_BUILDER_HPP__
14 #include "StateDirector.hpp"
15 #include "StateMachine.hpp"
54 bool addTransition(
int origin_id,
int destination_id,
int condition);
79 std::vector<State *> states;
80 std::vector<StateDirector *> stateDirectors;
93 #endif // __RD_STATE_MACHINE_BUILDER_HPP__
bool addTransition(int origin_id, int destination_id, int condition)
Adds a transition from one state to other one depending on a condition.
Definition: StateMachineBuilder.cpp:37
The main, catch-all namespace for Robot Devastation.
Definition: groups.dox:4
bool setInitialState(int initial_state_id)
Configure the initial state of the FiniteStateMachine.
Definition: StateMachineBuilder.cpp:25
bool setDirectorType(const std::string &type)
Select the type of StateDirector to be used.
Definition: StateMachineBuilder.cpp:19
Class implementing a finite state machine.
Definition: StateMachine.hpp:19
FiniteStateMachine * buildStateMachine()
Creates a FiniteStateMachine.
Definition: StateMachineBuilder.cpp:65
std::map< int, std::vector< std::pair< int, int > > > transition_table
Stores the transitions of the fsm.
Definition: StateMachineBuilder.hpp:87
Base class for each of the states of a FiniteStateMachine.
Definition: State.hpp:18
StateDirector * createStateDirector(const std::string &type, State *state)
Factory method to create a StateDirector from the type string.
Definition: StateMachineBuilder.cpp:114
int addState(State *state)
Adds a State to the FiniteStateMachine.
Definition: StateMachineBuilder.cpp:31
Class that helps with the creation of FiniteStateMachine.
Definition: StateMachineBuilder.hpp:25
A base class for controlling flow of States of a Finite State Machine.
Definition: StateDirector.hpp:19