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
State.h
- Committer:
- Siriagus
- Date:
- 2015-05-02
- Revision:
- 8:9ac6a428fa26
- Parent:
- 7:678873947b29
- Child:
- 10:f2488a0ecab7
File content as of revision 8:9ac6a428fa26:
#ifndef STATE_H #define STATE_H #include "N5110.h" #include "PinDetect.h" #include "InputManager.h" class StateManager; // List of main states in the game enum MainState {MAIN_MENU, GAME, SUBMIT_HIGHSCORE, GAME_OVER, NO_STATE, TITLE_SCREEN}; // Each main state is a derived from the State class. class State { public: State(StateManager* fsm, N5110 *lcd, InputManager* input) :lcd(lcd), input(input), fsm(fsm){} virtual void update(float dt) = 0; virtual void render() = 0; protected: void requestStateChange(MainState newState); void drawImage(const int img[BANKS][WIDTH]); // Draws an image from array protected: N5110 *lcd; InputManager *input; private: StateManager *fsm; }; #endif