4 * Created on: Aug 5, 2012
8 #ifndef BATTLE_BATTLESTATE_H_
9 #define BATTLE_BATTLESTATE_H_
11 #include "AttackTypeMenu.h"
14 #include "../app/State.h"
15 #include "../geometry/Point.h"
16 #include "../geometry/Vector.h"
21 namespace app { class Input; }
22 namespace graphics { class Sprite; }
28 // TODO: maybe split battle state into substates for each menu?
33 BattleState(SDL_Surface *background, const PartyLayout &monstersLayout, const PartyLayout &heroesLayout, const graphics::Sprite *attackIcons)
34 : background(background)
35 , monstersLayout(&monstersLayout)
36 , heroesLayout(&heroesLayout)
37 , attackTypeMenu(attackIcons) { }
40 void AddMonster(const Monster &);
41 void AddHero(const Hero &);
44 virtual void EnterState(app::Application &ctrl, SDL_Surface *screen);
45 virtual void ExitState();
47 virtual void Resize(int width, int height);
49 virtual void HandleInput(const app::Input &);
50 virtual void UpdateWorld(float deltaT);
51 virtual void Render(SDL_Surface *);
54 void RenderBackground(SDL_Surface *screen, const geometry::Vector<int> &offset);
55 void RenderMonsters(SDL_Surface *screen, const geometry::Vector<int> &offset);
56 void RenderHeroes(SDL_Surface *screen, const geometry::Vector<int> &offset);
59 SDL_Surface *background;
60 const PartyLayout *monstersLayout;
61 const PartyLayout *heroesLayout;
62 AttackTypeMenu attackTypeMenu;
63 std::vector<geometry::Point<int> > monsterPositions;
64 std::vector<geometry::Point<int> > heroesPositions;
65 std::vector<Monster> monsters;
66 std::vector<Hero> heroes;
72 #endif /* BATTLE_BATTLESTATE_H_ */