]> git.localhorst.tv Git - l2e.git/blob - src/battle/BattleState.h
added Hero class for battle state
[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 "Hero.h"
12 #include "Monster.h"
13 #include "../app/State.h"
14 #include "../geometry/Point.h"
15
16 #include <vector>
17 #include <SDL.h>
18
19 namespace battle {
20
21 class PartyLayout;
22
23 class BattleState
24 : public app::State {
25
26 public:
27         BattleState(SDL_Surface *background, const PartyLayout &monstersLayout, const PartyLayout &heroesLayout)
28         : background(background)
29         , monstersLayout(&monstersLayout)
30         , heroesLayout(&heroesLayout) { }
31
32 public:
33         void AddMonster(const Monster &);
34         void AddHero(const Hero &);
35
36 public:
37         virtual void EnterState(app::Application &ctrl, SDL_Surface *screen);
38         virtual void ExitState();
39
40         virtual void Resize(int width, int height);
41
42         virtual void HandleEvent(const SDL_Event &);
43         virtual void UpdateWorld(float deltaT);
44         virtual void Render(SDL_Surface *);
45
46 private:
47         SDL_Surface *background;
48         const PartyLayout *monstersLayout;
49         const PartyLayout *heroesLayout;
50         std::vector<geometry::Point<int> > monsterPositions;
51         std::vector<geometry::Point<int> > heroesPositions;
52         std::vector<Monster> monsters;
53         std::vector<Hero> heroes;
54
55 };
56
57 }
58
59 #endif /* BATTLE_BATTLESTATE_H_ */