]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.h
reworked Menu to include an optional number
[l2e.git] / src / battle / BattleState.h
index 65e8727906859fd442c174107ce92782d603fb1d..96a7ce20643d5b62f4aee3d3c9f0f68103280a3a 100644 (file)
 #include <SDL.h>
 
 namespace app { class Input; }
+namespace common {
+       class Inventory;
+       class Item;
+}
 namespace graphics {
        class Font;
        class Frame;
@@ -80,8 +84,10 @@ public:
        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</* Item */ void *> &GetItemMenu() { return itemMenu; }
-               const graphics::Menu</* Item */ void *> &GetItemMenu() const { return itemMenu; }
+       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 {
@@ -97,6 +103,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;
@@ -109,7 +118,8 @@ private:
        std::vector<Monster> monsters;
        std::vector<Hero> heroes;
        std::vector<graphics::Menu</* Spell */ void *> > spellMenus;
-       graphics::Menu</* Item */ void *> itemMenu;
+       graphics::Menu<const common::Item *> itemMenu;
+       std::vector<graphics::Menu</* Ikari or Item */ void *> > ikariMenus;
        std::vector<HeroTag> heroTags;
        std::vector<AttackChoice> attackChoices;
        int activeHero;