]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Interpreter.h
added interpretation of colors
[l2e.git] / src / loader / Interpreter.h
index 93a6e36227b576cc95744a80b4eb9522885e8a10..b91e4781d901cefbb4a5dfa446d2c6b6787e1660 100644 (file)
@@ -9,6 +9,7 @@
 #define LOADER_INTERPRETER_H_
 
 #include "../geometry/Vector.h"
+#include "../graphics/Color.h"
 #include "../graphics/ComplexAnimation.h"
 
 #include <map>
@@ -25,6 +26,8 @@ namespace battle {
 }
 
 namespace common {
+       class Ikari;
+       class Item;
        class Spell;
        class TargetingMode;
 }
@@ -66,13 +69,17 @@ public:
 public:
        graphics::Animation *GetAnimation(const std::string &name);
        bool GetBoolean(const std::string &name) const;
+       const graphics::Color &GetColor(const std::string &name) const;
        graphics::Font *GetFont(const std::string &name);
        graphics::Frame *GetFrame(const std::string &name);
        graphics::Gauge *GetGauge(const std::string &name);
        battle::Hero *GetHero(const std::string &name);
+       common::Ikari *GetIkari(const std::string &name);
+       common::Item *GetItem(const std::string &name);
        battle::Monster *GetMonster(const std::string &name);
        int GetNumber(const std::string &name) const;
        battle::PartyLayout *GetPartyLayout(const std::string &name);
+       const char *GetPath(const std::string &name) const;
        common::Spell *GetSpell(const std::string &name);
        graphics::Sprite *GetSprite(const std::string &name);
        const char *GetString(const std::string &name) const;
@@ -81,12 +88,15 @@ public:
 
 public:
        const std::vector<bool> &Booleans() const { return booleans; }
+       const std::vector<graphics::Color> &Colors() const { return colors; }
        const std::vector<graphics::ComplexAnimation *> &ComplexAnimations() const { return complexAnimations; }
        const std::vector<graphics::Font *> &Fonts() const { return fonts; }
        const std::vector<graphics::Frame *> &Frames() const { return frames; }
        const std::vector<graphics::Gauge *> &Gauges() const { return gauges; }
        const std::vector<battle::Hero *> &Heroes() const { return heroes; }
+       const std::vector<common::Ikari *> &Ikaris() const { return ikaris; }
        const std::vector<SDL_Surface *> &Images() const { return images; }
+       const std::vector<common::Item *> &Items() const { return items; }
        const std::vector<battle::Monster *> &Monsters() const { return monsters; }
        const std::vector<int> &Numbers() const { return numbers; }
        const std::vector<battle::PartyLayout *> &PartyLayouts() const { return partyLayouts; }
@@ -103,15 +113,20 @@ private:
        void ReadObject(const Definition &);
 
        graphics::Animation *GetAnimation(const Value &);
+       graphics::Color GetColor(const Value &);
        bool GetBoolean(const Value &);
        graphics::Font *GetFont(const Value &);
        graphics::Frame *GetFrame(const Value &);
        graphics::Gauge *GetGauge(const Value &);
+       battle::Hero *GetHero(const Value &);
+       common::Ikari *GetIkari(const Value &);
        SDL_Surface *GetImage(const Value &);
+       common::Item *GetItem(const Value &);
        int GetNumber(const Value &);
        battle::PartyLayout *GetPartyLayout(const Value &);
        const PropertyList *GetPropertyList(const Value &);
        const std::vector<PropertyList *> &GetPropertyListArray(const Value &);
+       const char *GetPath(const Value &);
        common::Spell *GetSpell(const Value &);
        graphics::Sprite *GetSprite(const Value &);
        const char *GetString(const Value &);
@@ -125,6 +140,8 @@ private:
        void ReadFrame(graphics::Frame &, const PropertyList &);
        void ReadGauge(graphics::Gauge &, const PropertyList &);
        void ReadHero(battle::Hero &, const PropertyList &);
+       void ReadIkari(common::Ikari &, const PropertyList &);
+       void ReadItem(common::Item &, const PropertyList &);
        void ReadMonster(battle::Monster &, const PropertyList &);
        void ReadPartyLayout(battle::PartyLayout &, const PropertyList &);
        void ReadSimpleAnimation(graphics::SimpleAnimation &, const PropertyList &);
@@ -137,15 +154,19 @@ private:
        const ParsedSource &source;
        enum Type {
                BOOLEAN,
+               COLOR,
                COMPLEX_ANIMATION,
                FONT,
                FRAME,
                GAUGE,
                HERO,
+               IKARI,
                IMAGE,
+               ITEM,
                MONSTER,
                NUMBER,
                PARTY_LAYOUT,
+               PATH,
                PROPERTY_LIST_ARRAY,
                SIMPLE_ANIMATION,
                SPELL,
@@ -164,13 +185,18 @@ private:
        };
        std::map<std::string, ParsedDefinition> parsedDefinitions;
 
+       std::map<std::string, SDL_Surface *> imageCache;
+
        std::vector<bool> booleans;
+       std::vector<graphics::Color> colors;
        std::vector<graphics::ComplexAnimation *> complexAnimations;
        std::vector<graphics::Font *> fonts;
        std::vector<graphics::Frame *> frames;
        std::vector<graphics::Gauge *> gauges;
        std::vector<battle::Hero *> heroes;
+       std::vector<common::Ikari *> ikaris;
        std::vector<SDL_Surface *> images;
+       std::vector<common::Item *> items;
        std::vector<battle::Monster *> monsters;
        std::vector<int> numbers;
        std::vector<battle::PartyLayout *> partyLayouts;