Open kiprasmel opened 4 years ago
struct StateMachine { const char *id; const char *initial; States states; + const char *value; - const char *transition(const char *currentState, const char *event) { + StateMachine *transition(const char *currentState, const char *event) { const char *nextState = this->states[currentState].on[event]; + this->value = nextState; - return nextState; + return this; } }