public void changeState(GameState state) { if (curStateType == state && curState != null) { return; } if (curState != null) { curState.exit(); } curState = getState(state); curState.enter(); curStateType = state; }
public void clear() { curState = null; }