namespace common {
class Inventory;
class Item;
+ class Spell;
}
namespace graphics {
class Font;
virtual void Resize(int width, int height);
- virtual void HandleInput(const app::Input &);
+ virtual void HandleEvents(const app::Input &);
virtual void UpdateWorld(float deltaT);
virtual void Render(SDL_Surface *);
const Hero &ActiveHero() const { return heroes[activeHero]; }
Hero &HeroAt(std::vector<Hero>::size_type index) { return heroes[index]; }
const Hero &HeroAt(std::vector<Hero>::size_type index) const { return heroes[index]; }
+ void SwapHeroes(std::vector<Hero>::size_type lhs, std::vector<Hero>::size_type rhs);
const HeroTag &ActiveHeroTag() const { return heroTags[activeHero]; }
const HeroTag &HeroTagAt(std::vector<Hero>::size_type index) const { return heroTags[index]; }
const geometry::Point<int> &HeroTagPositionAt(std::vector<Hero>::size_type index) const { return heroTagPositions[index]; }
void SetAttackType(AttackChoice::Type t) { attackChoices[activeHero].SetType(t); }
AttackChoice &ActiveHeroAttackChoice() { return attackChoices[activeHero]; }
const AttackChoice &ActiveHeroAttackChoice() const { return attackChoices[activeHero]; }
+ const AttackChoice &AttackChoiceAt(std::vector<Hero>::size_type index) const { return attackChoices[index]; }
TargetSelection &ActiveHeroTargets() { return attackChoices[activeHero].Selection(); }
const TargetSelection &ActiveHeroTargets() const { return attackChoices[activeHero].Selection(); }
bool AttackSelectionDone() const { return activeHero >= (int) heroes.size(); }
- graphics::Menu</* Spell */ void *> &GetSpellMenu() { return spellMenus[activeHero]; }
- const graphics::Menu</* Spell */ void *> &GetSpellMenu() const { return spellMenus[activeHero]; }
- graphics::Menu</* Ikari or Item */ void *> &GetIkariMenu() { return ikariMenus[activeHero]; }
- const graphics::Menu</* Ikari or Item */ void *> &GetIkariMenu() const { return ikariMenus[activeHero]; }
+ graphics::Menu<const common::Spell *> &GetSpellMenu() { return spellMenus[activeHero]; }
+ const graphics::Menu<const common::Spell *> &GetSpellMenu() const { return spellMenus[activeHero]; }
+ graphics::Menu<const common::Item *> &GetIkariMenu() { return ikariMenus[activeHero]; }
+ const graphics::Menu<const common::Item *> &GetIkariMenu() const { return ikariMenus[activeHero]; }
graphics::Menu<const common::Item *> &GetItemMenu() { return itemMenu; }
const graphics::Menu<const common::Item *> &GetItemMenu() const { return itemMenu; }
void RenderHeroTags(SDL_Surface *screen, const geometry::Vector<int> &offset);
private:
+ void LoadSpellMenu(std::vector<Hero>::size_type heroIndex);
+ void LoadIkariMenu(std::vector<Hero>::size_type heroIndex);
void LoadInventory();
private:
std::vector<geometry::Point<int> > heroesPositions;
std::vector<Monster> monsters;
std::vector<Hero> heroes;
- std::vector<graphics::Menu</* Spell */ void *> > spellMenus;
+ std::vector<graphics::Menu<const common::Spell *> > spellMenus;
graphics::Menu<const common::Item *> itemMenu;
- std::vector<graphics::Menu</* Ikari or Item */ void *> > ikariMenus;
+ std::vector<graphics::Menu<const common::Item *> > ikariMenus;
HeroTag heroTags[4];
geometry::Point<int> heroTagPositions[4];
AttackChoice attackChoices[4];