Progress towards a better application FSM, testing

This commit is contained in:
2021-09-06 23:18:43 -04:00
parent 983cd1423e
commit 7e59cd49e8
18 changed files with 462 additions and 17 deletions

View File

@@ -0,0 +1,15 @@
#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();
}