Andreas Garmannslund / Mbed 2 deprecated SimplePlatformGame

Dependencies:   N5110 PinDetect PowerControl mbed

Revision:
4:d6661b976359
Parent:
1:0cfe2255092a
Child:
5:100d960fc6d5
--- a/State.h	Tue Apr 28 15:42:22 2015 +0000
+++ b/State.h	Fri May 01 00:38:59 2015 +0000
@@ -1,10 +1,36 @@
 #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};
+
+// Each main state is a derived from the State class.
 class State
 {
     public:
-        virtual void run() {};
+    
+        State(StateManager* fsm, N5110 *lcd, InputManager* input)
+                : fsm(fsm), lcd(lcd), input(input){}
+                
+        virtual void update() = 0;
+        virtual void render() = 0;
+        
+    private:
+        void changeState(MainState newState);
+        
+    protected:
+        N5110 *lcd;
+        InputManager *input;
+        
+    private:
+        StateManager *fsm;
+        
 };
 
 #endif
\ No newline at end of file