state-handler: #6 add state controller functions
- HandleState to set an event of the state - SetState to update current state to new
This commit is contained in:
@@ -61,3 +61,14 @@ StateHandler::SetState (state_pointer newstate)
|
||||
current = newstate;
|
||||
(this->*current) (Event (Event::eEnter));
|
||||
}
|
||||
|
||||
void StateHandler::HandleState(const Event &event){
|
||||
(this->*current)(event);
|
||||
}
|
||||
|
||||
void StateHandler::SetState(state_pointer newstate){
|
||||
(this->*current)(Event(Event::eExit));
|
||||
current = newstate;
|
||||
(this->*current)(Event(Event::eEnter));
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user