]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.h
preliminary solution for loading inventory in item select
[l2e.git] / src / battle / BattleState.h
index 365f1983305fcb3de5139b295cb89947c6db2dd0..4b0ffcff43c591f41f754b62e3f983208ef1479c 100644 (file)
 #include "../graphics/Menu.h"
 
 #include <vector>
+#include <string>
 #include <SDL.h>
 
 namespace app { class Input; }
+namespace common {
+       class Inventory;
+       class Item;
+}
 namespace graphics {
        class Font;
        class Frame;
@@ -78,7 +83,12 @@ public:
        bool HasChosenAttackType() const { return attackChoices[activeHero].GetType() != AttackChoice::UNDECIDED; }
        void SetAttackType(AttackChoice::Type t) { attackChoices[activeHero].SetType(t); }
        bool AttackSelectionDone() const { return activeHero >= (int) heroes.size(); }
-       const graphics::Menu</* Spell */ void *> GetSpellMenu() const { return spellMenus[activeHero]; }
+       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::Item *> &GetItemMenu() { return itemMenu; }
+       const graphics::Menu<const common::Item *> &GetItemMenu() const { return itemMenu; }
 
 public:
        geometry::Vector<int> CalculateScreenOffset(SDL_Surface *screen) const {
@@ -94,6 +104,9 @@ public:
        void RenderHeroes(SDL_Surface *screen, const geometry::Vector<int> &offset);
        void RenderHeroTags(SDL_Surface *screen, const geometry::Vector<int> &offset);
 
+private:
+       void LoadInventory();
+
 private:
        SDL_Surface *background;
        const PartyLayout *monstersLayout;
@@ -106,6 +119,9 @@ private:
        std::vector<Monster> monsters;
        std::vector<Hero> heroes;
        std::vector<graphics::Menu</* Spell */ void *> > spellMenus;
+       graphics::Menu<const common::Item *> itemMenu;
+       std::vector<std::string> itemMenuStrings;
+       std::vector<graphics::Menu</* Ikari or Item */ void *> > ikariMenus;
        std::vector<HeroTag> heroTags;
        std::vector<AttackChoice> attackChoices;
        int activeHero;