]> git.localhorst.tv Git - l2e.git/blob - src/battle/states/SelectAttackType.h
extracted battle logic into a class
[l2e.git] / src / battle / states / SelectAttackType.h
1 #ifndef BATTLE_SELECTATTACKTYPE_H_
2 #define BATTLE_SELECTATTACKTYPE_H_
3
4 namespace battle {
5         class Battle;
6         class BattleState;
7         class HeroTag;
8         struct Resources;
9 }
10 namespace common {
11         class Item;
12 }
13 namespace graphics {
14         template<class>
15         class Menu;
16 }
17
18 #include "../../app/State.h"
19 #include "../../math/Vector.h"
20
21 namespace battle {
22
23 class SelectAttackType
24 : public app::State {
25
26 public:
27         SelectAttackType(Battle *battle, BattleState *parent);
28
29 public:
30         virtual void HandleEvents(const app::Input &);
31         virtual void UpdateWorld(Uint32 deltaT);
32         virtual void Render(SDL_Surface *);
33
34 public:
35         const Resources &Res() const;
36         graphics::Menu<const common::Item *> &ItemMenu();
37         const graphics::Menu<const common::Item *> &ItemMenu() const;
38         const HeroTag &HeroTagAt(int index) const;
39         const math::Vector<int> &HeroTagPositionAt(int index) const;
40
41         const math::Vector<int> &ScreenOffset() const;
42         int Width() const;
43         int Height() const;
44
45 private:
46         virtual void OnEnterState(SDL_Surface *screen);
47         virtual void OnExitState(SDL_Surface *screen);
48         virtual void OnResumeState(SDL_Surface *screen);
49         virtual void OnPauseState(SDL_Surface *screen);
50
51         virtual void OnResize(int width, int height);
52
53 private:
54         void RenderMenu(SDL_Surface *screen);
55
56 private:
57         Battle *battle;
58         BattleState *parent;
59         math::Vector<int> menuOffset;
60
61 };
62
63 }
64 #endif