-void BattleState::EnterState(Application &ctrl, SDL_Surface *screen) {
- monstersLayout->CalculatePositions(background->w, background->h, monsterPositions);
- heroesLayout->CalculatePositions(background->w, background->h, heroesPositions);
- attackChoices.resize(heroes.size());
- for (vector<Hero>::size_type i(0), end(heroes.size()); i < end; ++i) {
- spellMenus.push_back(res->spellMenuPrototype);
- // TODO: insert real spell menu entries
- spellMenus.back().Add("Reset : 0", 0);
- spellMenus.back().Add("Strong : 3", 0);
- spellMenus.back().Add("Stronger : 8", 0);
- spellMenus.back().Add("Champion :16", 0);
- spellMenus.back().Add("Rally :10", 0);
- spellMenus.back().Add("Valor :30", 0);
- spellMenus.back().Add("Poison : 2", 0);
- spellMenus.back().Add("Release : 2", 0);
- spellMenus.back().Add("Waken : 4", 0);
- spellMenus.back().Add("Fake : 4", 0);
- spellMenus.back().Add("Trick : 5", 0);
- heroTags.push_back(HeroTag(&heroes[i], &attackChoices[i], res, HeroTag::Alignment((i + 1) % 2)));
+void BattleState::OnEnterState(SDL_Surface *screen) {
+ for (int i(0); i < 4; ++i) {
+ Hero &hero = HeroAt(i);
+ hero.Position() = battle.HeroesLayout().CalculatePosition(i, background->w, background->h);
+ hero.SpellMenu() = *res->spellMenuProperties;
+ hero.UpdateSpellMenu();
+ hero.IkariMenu() = *res->ikariMenuProperties;
+ hero.UpdateIkariMenu(res);
+ heroTags[i] = HeroTag(this, i);
+ smallHeroTags[i] = SmallHeroTag(this, i);