| 25 | } |
| 26 | |
| 27 | void StateManager::pushState(StateController* _state) |
| 28 | { |
| 29 | MYGUI_ASSERT(_state != nullptr, "State not found"); |
| 30 | MYGUI_ASSERT(std::find(mStates.begin(), mStates.end(), _state) == mStates.end(), "State already added"); |
| 31 | |
| 32 | StateController* pauseState = getCurentState(); |
| 33 | |
| 34 | mStates.push_back(_state); |
| 35 | |
| 36 | if (pauseState != nullptr) |
| 37 | pauseState->pauseState(); |
| 38 | |
| 39 | _state->initState(); |
| 40 | } |
| 41 | |
| 42 | void StateManager::pushState(std::string_view _stateName) |
| 43 | { |
no test coverage detected