before handler must be called right before switching to the next state
This commit is contained in:
parent
4712c1b423
commit
9db96a2b37
@ -149,9 +149,9 @@ public class Fsm<T extends Fsm, E> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
currentState.process(event);
|
currentState.process(event);
|
||||||
currentState.afterEvent();
|
|
||||||
if (currentState.isFinish()) {
|
if (currentState.isFinish()) {
|
||||||
done = true;
|
done = true;
|
||||||
|
currentState.afterEvent();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switchToNextState(event);
|
switchToNextState(event);
|
||||||
@ -278,6 +278,7 @@ public class Fsm<T extends Fsm, E> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void nextState(State<E> state, E event) {
|
private void nextState(State<E> state, E event) {
|
||||||
|
currentState.afterEvent();
|
||||||
previousState = currentState;
|
previousState = currentState;
|
||||||
currentState = state;
|
currentState = state;
|
||||||
currentState.beforeEvent();
|
currentState.beforeEvent();
|
||||||
|
Loading…
Reference in New Issue
Block a user