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