X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FInterpreter.h;h=ffbad42e1a6ef1e2897305c55a04ad3090e38832;hb=f3230836ca2e263e84b58ffec6645c0f77439117;hp=a32b3cad6d4c8a90cd8401f25c868955c2dd23fc;hpb=4634bd26d24a163b7128df7dd5183fcb2cdc8031;p=l2e.git diff --git a/src/loader/Interpreter.h b/src/loader/Interpreter.h index a32b3ca..ffbad42 100644 --- a/src/loader/Interpreter.h +++ b/src/loader/Interpreter.h @@ -20,11 +20,22 @@ namespace battle { class Hero; class Monster; + class PartyLayout; class Stats; } +namespace common { + class Ikari; + class Item; + class Spell; + class TargetingMode; +} + namespace graphics { class Animation; + class Font; + class Frame; + class Gauge; class SimpleAnimation; class Sprite; } @@ -56,10 +67,41 @@ public: public: graphics::Animation *GetAnimation(const std::string &name); + bool GetBoolean(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); + common::Spell *GetSpell(const std::string &name); graphics::Sprite *GetSprite(const std::string &name); + const char *GetString(const std::string &name) const; + common::TargetingMode *GetTargetingMode(const std::string &name); + geometry::Vector GetVector(const std::string &name) const; + +public: + const std::vector &Booleans() const { return booleans; } + const std::vector &ComplexAnimations() const { return complexAnimations; } + const std::vector &Fonts() const { return fonts; } + const std::vector &Frames() const { return frames; } + const std::vector &Gauges() const { return gauges; } + const std::vector &Heroes() const { return heroes; } + const std::vector &Ikaris() const { return ikaris; } + const std::vector &Images() const { return images; } + const std::vector &Items() const { return items; } + const std::vector &Monsters() const { return monsters; } + const std::vector &Numbers() const { return numbers; } + const std::vector &PartyLayouts() const { return partyLayouts; } + const std::vector &SimpleAnimations() const { return simpleAnimations; } + const std::vector &Spells() const { return spells; } + const std::vector &Sprites() const { return sprites; } + const std::vector &Strings() const { return strings; } + const std::vector &TargetingModes() const { return targetingModes; } + const std::vector > &Vectors() const { return vectors; } private: void ReadDefinition(const Definition &); @@ -67,51 +109,95 @@ private: void ReadObject(const Definition &); graphics::Animation *GetAnimation(const Value &); - const std::vector &GetValueArray(const Value &); - const std::vector &GetPropertyListArray(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 &GetPropertyListArray(const Value &); + common::Spell *GetSpell(const Value &); graphics::Sprite *GetSprite(const Value &); const char *GetString(const Value &); + common::TargetingMode *GetTargetingMode(const Value &); + const std::vector &GetValueArray(const Value &); geometry::Vector GetVector(const Value &); void ReadComplexAnimation(graphics::ComplexAnimation &, const PropertyList &); void ReadComplexAnimationFrame(graphics::ComplexAnimation::FrameProp &, const PropertyList &); + void ReadFont(graphics::Font &, const PropertyList &); + 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 &); + void ReadSpell(common::Spell &, const PropertyList &); void ReadSprite(graphics::Sprite &, const PropertyList &); void ReadStats(battle::Stats &, const PropertyList &); + void ReadTargetingMode(common::TargetingMode &, const PropertyList &); private: const ParsedSource &source; - enum DynamicType { - ANIMATION, + enum Type { + BOOLEAN, COMPLEX_ANIMATION, + FONT, + FRAME, + GAUGE, HERO, + IKARI, + IMAGE, + ITEM, MONSTER, NUMBER, + PARTY_LAYOUT, + PROPERTY_LIST_ARRAY, SIMPLE_ANIMATION, + SPELL, SPRITE, + STRING, + TARGETING_MODE, + VECTOR, + VALUE_ARRAY, }; struct ParsedDefinition { - ParsedDefinition(const Definition *dfn, DynamicType type, int index) + ParsedDefinition(const Definition *dfn, Type type, int index) : dfn(dfn), type(type), index(index) { } - bool IsCompatible(DynamicType with) const; const Definition *dfn; - DynamicType type; + Type type; int index; }; std::map parsedDefinitions; - std::vector animations; - std::vector heroes; + std::vector booleans; + std::vector complexAnimations; + std::vector fonts; + std::vector frames; + std::vector gauges; + std::vector heroes; + std::vector ikaris; std::vector images; - std::vector monsters; + std::vector items; + std::vector monsters; std::vector numbers; - std::vector sprites; + std::vector partyLayouts; + std::vector propertyLists; + std::vector > propertyListArrays; + std::vector simpleAnimations; + std::vector spells; + std::vector sprites; + std::vector strings; + std::vector targetingModes; + std::vector > valueArrays; + std::vector > vectors; };