]> git.localhorst.tv Git - l2e.git/blob - src/battle/BattleState.h
added prototype for battle's hero tags
[l2e.git] / src / battle / BattleState.h
1 /*
2  * BattleState.h
3  *
4  *  Created on: Aug 5, 2012
5  *      Author: holy
6  */
7
8 #ifndef BATTLE_BATTLESTATE_H_
9 #define BATTLE_BATTLESTATE_H_
10
11 #include "AttackTypeMenu.h"
12 #include "Hero.h"
13 #include "HeroTag.h"
14 #include "Monster.h"
15 #include "../app/State.h"
16 #include "../geometry/Point.h"
17 #include "../geometry/Vector.h"
18
19 #include <vector>
20 #include <SDL.h>
21
22 namespace app { class Input; }
23 namespace graphics { class Sprite; }
24
25 namespace battle {
26
27 class PartyLayout;
28
29 // TODO: maybe split battle state into substates for each menu?
30 class BattleState
31 : public app::State {
32
33 public:
34         BattleState(SDL_Surface *background, const PartyLayout &monstersLayout, const PartyLayout &heroesLayout, const graphics::Sprite *attackIcons)
35         : background(background)
36         , monstersLayout(&monstersLayout)
37         , heroesLayout(&heroesLayout)
38         , attackTypeMenu(attackIcons) { }
39
40 public:
41         void AddMonster(const Monster &);
42         void AddHero(const Hero &);
43
44 public:
45         virtual void EnterState(app::Application &ctrl, SDL_Surface *screen);
46         virtual void ExitState();
47
48         virtual void Resize(int width, int height);
49
50         virtual void HandleInput(const app::Input &);
51         virtual void UpdateWorld(float deltaT);
52         virtual void Render(SDL_Surface *);
53
54 private:
55         void RenderBackground(SDL_Surface *screen, const geometry::Vector<int> &offset);
56         void RenderMonsters(SDL_Surface *screen, const geometry::Vector<int> &offset);
57         void RenderHeroes(SDL_Surface *screen, const geometry::Vector<int> &offset);
58         void RenderHeroTags(SDL_Surface *screen, const geometry::Vector<int> &offset);
59         void RenderAttackTypeMenu(SDL_Surface *screen, const geometry::Vector<int> &offset);
60
61 private:
62         SDL_Surface *background;
63         const PartyLayout *monstersLayout;
64         const PartyLayout *heroesLayout;
65         AttackTypeMenu attackTypeMenu;
66         std::vector<geometry::Point<int> > monsterPositions;
67         std::vector<geometry::Point<int> > heroesPositions;
68         std::vector<Monster> monsters;
69         std::vector<Hero> heroes;
70         std::vector<HeroTag> heroTags;
71
72 };
73
74 }
75
76 #endif /* BATTLE_BATTLESTATE_H_ */