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"
20 namespace app { class Input; }
30 BattleState(SDL_Surface *background, const PartyLayout &monstersLayout, const PartyLayout &heroesLayout)
31 : background(background)
32 , monstersLayout(&monstersLayout)
33 , heroesLayout(&heroesLayout) { }
36 void AddMonster(const Monster &);
37 void AddHero(const Hero &);
40 virtual void EnterState(app::Application &ctrl, SDL_Surface *screen);
41 virtual void ExitState();
43 virtual void Resize(int width, int height);
45 virtual void HandleInput(const app::Input &);
46 virtual void UpdateWorld(float deltaT);
47 virtual void Render(SDL_Surface *);
50 void RenderBackground(SDL_Surface *screen, const geometry::Vector<int> &offset);
51 void RenderMonsters(SDL_Surface *screen, const geometry::Vector<int> &offset);
52 void RenderHeroes(SDL_Surface *screen, const geometry::Vector<int> &offset);
55 SDL_Surface *background;
56 const PartyLayout *monstersLayout;
57 const PartyLayout *heroesLayout;
58 std::vector<geometry::Point<int> > monsterPositions;
59 std::vector<geometry::Point<int> > heroesPositions;
60 std::vector<Monster> monsters;
61 std::vector<Hero> heroes;
67 #endif /* BATTLE_BATTLESTATE_H_ */