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: State.h
- Revision:
- 7:678873947b29
- Parent:
- 5:100d960fc6d5
- Child:
- 8:9ac6a428fa26
--- a/State.h Fri May 01 09:44:38 2015 +0000 +++ b/State.h Fri May 01 18:10:59 2015 +0000 @@ -8,7 +8,7 @@ class StateManager; // List of main states in the game -enum MainState {MAIN_MENU, GAME, SUBMIT_HIGHSCORE, GAME_OVER}; +enum MainState {MAIN_MENU, GAME, SUBMIT_HIGHSCORE, GAME_OVER, NO_STATE}; // Each main state is a derived from the State class. @@ -17,13 +17,13 @@ public: State(StateManager* fsm, N5110 *lcd, InputManager* input) - :lcd(lcd), input(input){} + :lcd(lcd), input(input), fsm(fsm){} - virtual void update(time_t dt) = 0; + virtual void update(float dt) = 0; virtual void render() = 0; - private: - void changeState(MainState newState); + protected: + void requestStateChange(MainState newState); protected: N5110 *lcd; @@ -34,6 +34,4 @@ }; - - #endif \ No newline at end of file