X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FBattleState.h;h=4fd9a15165696399e2100190c51b77b7c1ff44b3;hb=fde7b27297882a7f033641df92e732abd137b532;hp=4964efb81f788be75e23445c28f2e1e00b09805b;hpb=cd302c7f04e5d0cdfd8e15322a02e84577ad2672;p=l2e.git diff --git a/src/battle/BattleState.h b/src/battle/BattleState.h index 4964efb..4fd9a15 100644 --- a/src/battle/BattleState.h +++ b/src/battle/BattleState.h @@ -78,18 +78,13 @@ public: virtual void UpdateWorld(float deltaT); virtual void Render(SDL_Surface *); - // TODO: turn this mess into a well stuctured interface public: const Resources &Res() const { return *res; } AttackTypeMenu &GetAttackTypeMenu() { return attackTypeMenu; } MoveMenu &GetMoveMenu() { return moveMenu; } - graphics::Menu &GetSpellMenu() { assert(activeHero >= 0 && activeHero < NumHeroes()); return heroes[activeHero].SpellMenu(); } - const graphics::Menu &GetSpellMenu() const { assert(activeHero >= 0 && activeHero < NumHeroes()); return heroes[activeHero].SpellMenu(); } - graphics::Menu &GetIkariMenu() { assert(activeHero >= 0 && activeHero < NumHeroes()); return heroes[activeHero].IkariMenu(); } - const graphics::Menu &GetIkariMenu() const { assert(activeHero >= 0 && activeHero < NumHeroes()); return heroes[activeHero].IkariMenu(); } - graphics::Menu &GetItemMenu() { return itemMenu; } - const graphics::Menu &GetItemMenu() const { return itemMenu; } + graphics::Menu &ItemMenu() { return itemMenu; } + const graphics::Menu &ItemMenu() const { return itemMenu; } void NextHero(); bool BeforeFirstHero() const { return activeHero < 0; } @@ -113,9 +108,7 @@ public: int MaxHeroes() const { return 4; } int MaxMonsters() const { return monsters.size(); } - const std::vector > &MonsterPositions() const { return monsterPositions; } bool MonsterPositionOccupied(int index) { return index >= 0 && index < int(monsters.size()) && monsters[index].Health() > 0; } - const std::vector > &HeroesPositions() const { return heroesPositions; } bool HeroPositionOccupied(int index) const { return index >= 0 && index < numHeroes; } void SetRunaway() { ranAway = true; } @@ -157,6 +150,7 @@ public: private: void LoadInventory(); + void DecideMonsterAttack(Monster &); Uint16 CalculateDamage(const Stats &attacker, const Stats &defender) const; private: @@ -166,9 +160,6 @@ private: const Resources *res; AttackTypeMenu attackTypeMenu; MoveMenu moveMenu; - // TODO: combine all data about heros or monsters - std::vector > monsterPositions; - std::vector > heroesPositions; std::vector monsters; std::vector attackOrder; Hero heroes[4];