MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / setState

Method setState

src/Engine/Game.cpp:398–406  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

396 * @param state Pointer to the new state.
397 */
398void 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.

Callers 12

mainFunction · 0.80
btnOkClickMethod · 0.80
thinkMethod · 0.80
btnYesClickMethod · 0.80
btnOkClickMethod · 0.80
initMethod · 0.80
initMethod · 0.80
restartMethod · 0.80
btnOkClickMethod · 0.80
initMethod · 0.80
screenClickMethod · 0.80
screenClickMethod · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected