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
Diff: StateManger.cpp
- Revision:
- 17:d6a3b29cab31
- Parent:
- 10:f2488a0ecab7
- Child:
- 19:89c3eeb3761b
diff -r caf613d5b85e -r d6a3b29cab31 StateManger.cpp --- a/StateManger.cpp Sun May 10 13:14:33 2015 +0000 +++ b/StateManger.cpp Mon May 11 03:52:18 2015 +0000 @@ -1,5 +1,7 @@ #include "StateManager.h" +/// @file StateManager.cpp + void StateManager::changeState(MainState newState) { if (currentState != 0) // if a state exist @@ -9,26 +11,27 @@ switch (newState) { case MAIN_MENU: - currentState = new MainMenu(this, lcd, input); + currentState = new MainMenu(this, lcd, input, sound); break; case GAME: - currentState = new Game(this, lcd, input); + currentState = new Game(this, lcd, input, sound); break; case TITLE_SCREEN: - currentState = new TitleScreen(this, lcd, input); + currentState = new TitleScreen(this, lcd, input, sound); + break; + + case SUBMIT_HIGHSCORE: + currentState = new SubmitHighscore(this, lcd, input, sound); break; - // TODO: Make classes for the other states. - case SUBMIT_HIGHSCORE: - //break; - case GAME_OVER: - //break; + currentState = new GameOver(this, lcd, input, sound); + break; default: - error("Invalid state!"); + ; // error: this shouldn't happen } }