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: N5110 PinDetect PowerControl mbed
StateManager.h
- Committer:
- Siriagus
- Date:
- 2015-05-01
- Revision:
- 5:100d960fc6d5
- Parent:
- 4:d6661b976359
- Child:
- 7:678873947b29
File content as of revision 5:100d960fc6d5:
#ifndef STATE_MANAGER_H
#define STATE_MANAGER_H
#include "State.h"
#include "MainMenu.h"
#include <map>
// Main Finite State Machine - controls the flow between the main states
class StateManager
{
public:
StateManager(N5110 *lcd, InputManager* input)
: lcd(lcd), input(input){currentState = 0;}
~StateManager() {if (currentState != 0) delete currentState;}
void update(time_t dt);
void render();
void changeState(MainState newState); // Deletes the current main state and creates a new one
private:
N5110 *lcd;
InputManager *input;
State* currentState; // Current state object
};
#endif