4 * Created on: Aug 5, 2012
8 #ifndef BATTLE_BATTLESTATE_H_
9 #define BATTLE_BATTLESTATE_H_
13 #include "../app/State.h"
14 #include "../geometry/Point.h"
15 #include "../geometry/Vector.h"
28 BattleState(SDL_Surface *background, const PartyLayout &monstersLayout, const PartyLayout &heroesLayout)
29 : background(background)
30 , monstersLayout(&monstersLayout)
31 , heroesLayout(&heroesLayout) { }
34 void AddMonster(const Monster &);
35 void AddHero(const Hero &);
38 virtual void EnterState(app::Application &ctrl, SDL_Surface *screen);
39 virtual void ExitState();
41 virtual void Resize(int width, int height);
43 virtual void HandleEvent(const SDL_Event &);
44 virtual void UpdateWorld(float deltaT);
45 virtual void Render(SDL_Surface *);
48 void RenderBackground(SDL_Surface *screen, const geometry::Vector<int> &offset);
49 void RenderMonsters(SDL_Surface *screen, const geometry::Vector<int> &offset);
50 void RenderHeroes(SDL_Surface *screen, const geometry::Vector<int> &offset);
53 SDL_Surface *background;
54 const PartyLayout *monstersLayout;
55 const PartyLayout *heroesLayout;
56 std::vector<geometry::Point<int> > monsterPositions;
57 std::vector<geometry::Point<int> > heroesPositions;
58 std::vector<Monster> monsters;
59 std::vector<Hero> heroes;
65 #endif /* BATTLE_BATTLESTATE_H_ */