* Pops all the states currently in stack and pushes in the new state. * A shortcut for cleaning up all the old states when they're not necessary * like in one-way transitions. * @param state Pointer to the new state. */
| 396 | * @param state Pointer to the new state. |
| 397 | */ |
| 398 | void Game::setState(State *state) |
| 399 | { |
| 400 | while (!_states.empty()) |
| 401 | { |
| 402 | popState(); |
| 403 | } |
| 404 | pushState(state); |
| 405 | _init = false; |
| 406 | } |
| 407 | |
| 408 | /** |
| 409 | * Pushes a new state into the top of the stack and initializes it. |
no test coverage detected