]> git.localhorst.tv Git - l2e.git/blobdiff - src/app/Application.h
split battle state into (so far) 2 states
[l2e.git] / src / app / Application.h
index 159f627c0a87f1c4ab62e63eaf67594d4d30de9d..dcc5e006c0dc36d28b65859bcbb048761cfc96be 100644 (file)
@@ -8,9 +8,11 @@
 #ifndef APP_APPLICATION_H_
 #define APP_APPLICATION_H_
 
+#include "Input.h"
 #include "../sdl/InitScreen.h"
 
 #include <stack>
+#include <queue>
 #include <SDL.h>
 
 
@@ -21,37 +23,43 @@ class State;
 class Application {
 
 public:
-       explicit Application(SDL_Surface *screen, State *initialState);
-       ~Application(void);
+       Application(sdl::InitScreen *screen, State *initialState);
+       ~Application();
 private:
        Application(const Application &);
        Application &operator =(const Application &);
 
 public:
-       void Run(void);
-       void Loop(void);
+       void Run();
+       void Loop();
 
 public:
        void ChangeState(State *);
        void PushState(State *);
-       void PopState(void);
-       void Quit(void);
+       void PopState();
+       void Quit();
+       Input &Buttons() { return input; }
+       const Input &Buttons() const { return input; }
 
 private:
-       State *CurrentState(void);
+       State *CurrentState();
+       void UpdateState();
        void RealPushState(State *);
-       void RealPopState(void);
-       void PopAllStates(void);
+       void RealPopState();
+       void PopAllStates();
 
 private:
-       void HandleEvents(void);
+       void HandleEvents();
        void UpdateWorld(Uint32 deltaT);
-       void Render(void);
+       void Render();
 
 private:
-       SDL_Surface *screen;
+       sdl::InitScreen *screen;
        std::stack<State *> states;
+       std::queue<State *> toPush;
+       Input input;
        Uint32 last;
+       int toPop;
 
 };