4 * Created on: Aug 5, 2012
8 #ifndef BATTLE_BATTLESTATE_H_
9 #define BATTLE_BATTLESTATE_H_
11 #include "AttackTypeMenu.h"
16 #include "../app/State.h"
17 #include "../geometry/Point.h"
18 #include "../geometry/Vector.h"
23 namespace app { class Input; }
24 namespace graphics { class Sprite; }
30 // TODO: maybe split battle state into substates for each menu?
35 BattleState(SDL_Surface *background, const PartyLayout &monstersLayout, const PartyLayout &heroesLayout, const graphics::Sprite *attackIcons, const graphics::Sprite *moveIcons)
36 : background(background)
37 , monstersLayout(&monstersLayout)
38 , heroesLayout(&heroesLayout)
39 , attackTypeMenu(attackIcons)
45 void AddMonster(const Monster &);
46 void AddHero(const Hero &);
49 virtual void EnterState(app::Application &ctrl, SDL_Surface *screen);
50 virtual void ExitState();
52 virtual void Resize(int width, int height);
54 virtual void HandleInput(const app::Input &);
55 virtual void UpdateWorld(float deltaT);
56 virtual void Render(SDL_Surface *);
59 void RenderBackground(SDL_Surface *screen, const geometry::Vector<int> &offset);
60 void RenderMonsters(SDL_Surface *screen, const geometry::Vector<int> &offset);
61 void RenderHeroes(SDL_Surface *screen, const geometry::Vector<int> &offset);
62 void RenderHeroTags(SDL_Surface *screen, const geometry::Vector<int> &offset);
63 void RenderAttackTypeMenu(SDL_Surface *screen, const geometry::Vector<int> &offset);
64 void RenderMoveMenu(SDL_Surface *screen, const geometry::Vector<int> &offset);
67 SDL_Surface *background;
68 const PartyLayout *monstersLayout;
69 const PartyLayout *heroesLayout;
70 AttackTypeMenu attackTypeMenu;
72 std::vector<geometry::Point<int> > monsterPositions;
73 std::vector<geometry::Point<int> > heroesPositions;
74 std::vector<Monster> monsters;
75 std::vector<Hero> heroes;
76 std::vector<HeroTag> heroTags;
84 #endif /* BATTLE_BATTLESTATE_H_ */