]> git.localhorst.tv Git - l2e.git/blob - src/battle/states/VictoryState.h
41a541e87c4ed78eb9d7401f9972df15ad6ad7df
[l2e.git] / src / battle / states / VictoryState.h
1 #ifndef BATTLE_VICTORYSTATE_H_
2 #define BATTLE_VICTORYSTATE_H_
3
4 namespace battle {
5         class Battle;
6         class BattleState;
7 }
8
9 #include "../../app/State.h"
10 #include "../../common/Hero.h"
11 #include "../../math/Vector.h"
12
13 #include <string>
14 #include <vector>
15
16 namespace battle {
17
18 class VictoryState
19 : public app::State {
20
21 public:
22         VictoryState(
23                         Battle *battle,
24                         BattleState *parent)
25         : battle(battle)
26         , parent(parent)
27         , cursor(0)
28         , stalling(false) { }
29
30 public:
31         virtual void HandleEvents(const app::Input &);
32         virtual void UpdateWorld(Uint32 deltaT);
33         virtual void Render(SDL_Surface *);
34
35 private:
36         virtual void OnEnterState(SDL_Surface *screen);
37         virtual void OnExitState(SDL_Surface *screen);
38         virtual void OnResumeState(SDL_Surface *screen);
39         virtual void OnPauseState(SDL_Surface *screen);
40
41         virtual void OnResize(int width, int height);
42
43 private:
44         void LoadResults();
45         void LoadResults(
46                         const char *,
47                         const std::vector<common::Hero::UpgradeInfo> &,
48                         std::vector<std::string> &);
49         void RenderFrame(SDL_Surface *screen);
50         void RenderLines(SDL_Surface *screen);
51
52 private:
53         Battle *battle;
54         BattleState *parent;
55         app::Timer<Uint32> timer;
56         std::vector<std::string> lines;
57         math::Vector<int> framePosition;
58         math::Vector<int> frameSize;
59         math::Vector<int> textPosition;
60         int cursor;
61         bool stalling;
62
63 };
64
65 }
66
67 #endif