16 lines
262 B
C++
16 lines
262 B
C++
#include "Fsm.h"
|
|
|
|
Fsm::Fsm(State &initialState) :
|
|
current_state(&initialState)
|
|
{}
|
|
|
|
void Fsm::transition(State &state) {
|
|
current_state->onExit();
|
|
current_state = &state;
|
|
current_state->onEntry();
|
|
}
|
|
|
|
void Fsm::step() {
|
|
current_state->step();
|
|
}
|