]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/states/DefeatState.h
added basic defeat state
[l2e.git] / src / battle / states / DefeatState.h
diff --git a/src/battle/states/DefeatState.h b/src/battle/states/DefeatState.h
new file mode 100644 (file)
index 0000000..998bff4
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef BATTLE_DEFEATSTATE_H_
+#define BATTLE_DEFEATSTATE_H_
+
+namespace battle {
+       class Battle;
+       class BattleState;
+}
+
+#include "../../app/State.h"
+#include "../../math/Vector.h"
+
+#include <SDL.h>
+
+namespace battle {
+
+class DefeatState
+: public app::State {
+
+public:
+       DefeatState(
+                       Battle *battle,
+                       BattleState *parent);
+
+public:
+       virtual void HandleEvents(const app::Input &);
+       virtual void UpdateWorld(Uint32 deltaT);
+       virtual void Render(SDL_Surface *);
+
+private:
+       virtual void OnEnterState(SDL_Surface *screen);
+       virtual void OnExitState(SDL_Surface *screen);
+       virtual void OnResumeState(SDL_Surface *screen);
+       virtual void OnPauseState(SDL_Surface *screen);
+
+       virtual void OnResize(int width, int height);
+
+private:
+       void RenderTitleBar(SDL_Surface *screen);
+
+private:
+       Battle *battle;
+       BattleState *parent;
+       SDL_Surface *cache;
+       SDL_PixelFormat *format;
+       app::Timer<Uint32> timer;
+       math::Vector<int> framePosition;
+       math::Vector<int> frameSize;
+       math::Vector<int> textPosition;
+
+};
+
+}
+
+#endif