/** * The App object takes care of initializing the even system. */ NoDice::App:: App(const NoDice::Config& config) : m_config(config) , m_sdlInit() , m_video(m_config) { std::srand(std::time(NULL)); pushGameState(GameStatePtr(new IntroState(m_config, m_video))); }
void StateManager::pushState(GameState *state) { if (!_states.empty()) { _states.top()->becomeInactive(); } state->manager = this; _states.push(GameStatePtr(state)); state->becomeActive(); lcl_log(lcl_cState, lcl_vTrace, "Pushed a state: %ld left", _states.size()); }
bool DronGame::Init() { gameStatePtr_ = GameStatePtr(new SplashScreen(GetName())); std::cout << GetName() << " initialized." << std::endl; return true; }