diff --git a/src/StateMachine.cpp b/src/StateMachine.cpp index 116ba43..85b9ee3 100644 --- a/src/StateMachine.cpp +++ b/src/StateMachine.cpp @@ -68,4 +68,8 @@ int StateMachine::transitionTo(int i){ return i; } return currentState; -} \ No newline at end of file +} + +bool StateMachine::isInState(State* s){ + return this->stateList->get(this->currentState) == s; +} diff --git a/src/StateMachine.h b/src/StateMachine.h index 1c1f877..c6bcc42 100644 --- a/src/StateMachine.h +++ b/src/StateMachine.h @@ -19,6 +19,7 @@ class StateMachine State* addState(void (*functionPointer)()); State* transitionTo(State* s); int transitionTo(int i); + bool isInState(State* s); // Attributes LinkedList *stateList;