4 * Created on: Aug 5, 2012
8 #ifndef BATTLE_BATTLESTATE_H_
9 #define BATTLE_BATTLESTATE_H_
11 #include "AttackTypeMenu.h"
15 #include "../app/State.h"
16 #include "../geometry/Point.h"
17 #include "../geometry/Vector.h"
22 namespace app { class Input; }
23 namespace graphics { class Sprite; }
29 // TODO: maybe split battle state into substates for each menu?
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) { }
41 void AddMonster(const Monster &);
42 void AddHero(const Hero &);
45 virtual void EnterState(app::Application &ctrl, SDL_Surface *screen);
46 virtual void ExitState();
48 virtual void Resize(int width, int height);
50 virtual void HandleInput(const app::Input &);
51 virtual void UpdateWorld(float deltaT);
52 virtual void Render(SDL_Surface *);
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);
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;
76 #endif /* BATTLE_BATTLESTATE_H_ */