Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed N5110 ShiftReg PinDetect
StateManger.cpp
- Committer:
- Siriagus
- Date:
- 2015-05-01
- Revision:
- 5:100d960fc6d5
- Child:
- 7:678873947b29
File content as of revision 5:100d960fc6d5:
#include "StateManager.h" // Delete the old state and create a new one void StateManager::changeState(MainState newState) { if (currentState != 0) // if a state exist delete currentState; // delete the old state // Create new state switch (newState) { case MAIN_MENU: currentState = new MainMenu(this, lcd, input); break; // TODO: Make classes for the other states, currently all than MAIN_MENU will give error case GAME: //break; case SUBMIT_HIGHSCORE: //break; case GAME_OVER: //break; default: error("Invalid state!"); } } void StateManager::update(time_t dt) { currentState->update(dt); } void StateManager::render() { currentState->render(); }