X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FInterpreter.h;h=2748c63bdadfa44e80539fca52d9517cb4636822;hb=fd987cc573ec47aa134b3bad46aa6ced9c6b6074;hp=c2fc25f84b6a1b6cb09edf1492e046f1e13c50d2;hpb=107b78b720db69ad402c09c0b1d9beb3b88a1952;p=l2e.git diff --git a/src/loader/Interpreter.h b/src/loader/Interpreter.h index c2fc25f..2748c63 100644 --- a/src/loader/Interpreter.h +++ b/src/loader/Interpreter.h @@ -8,13 +8,26 @@ #ifndef LOADER_INTERPRETER_H_ #define LOADER_INTERPRETER_H_ +#include "../geometry/Vector.h" +#include "../graphics/ComplexAnimation.h" + #include +#include #include #include #include +#include namespace battle { + class Hero; class Monster; + class Stats; +} + +namespace graphics { + class Animation; + class SimpleAnimation; + class Sprite; } namespace loader { @@ -22,6 +35,7 @@ namespace loader { class Definition; class ParsedSource; class PropertyList; +class Value; class Interpreter { @@ -41,15 +55,46 @@ private: public: void ReadSource(); +public: + graphics::Animation *GetAnimation(const std::string &name); + battle::Hero *GetHero(const std::string &name); + battle::Monster *GetMonster(const std::string &name); + int GetNumber(const std::string &name) const; + graphics::Sprite *GetSprite(const std::string &name); + private: + void ReadDefinition(const Definition &); void ReadLiteral(const Definition &); 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 &); + SDL_Surface *GetImage(const Value &); + int GetNumber(const Value &); + const PropertyList *GetPropertyList(const Value &); + graphics::Sprite *GetSprite(const Value &); + const char *GetString(const Value &); + geometry::Vector GetVector(const Value &); + + void ReadComplexAnimation(graphics::ComplexAnimation &, const PropertyList &); + void ReadComplexAnimationFrame(graphics::ComplexAnimation::FrameProp &, const PropertyList &); + void ReadHero(battle::Hero &, const PropertyList &); void ReadMonster(battle::Monster &, const PropertyList &); + void ReadSimpleAnimation(graphics::SimpleAnimation &, const PropertyList &); + void ReadSprite(graphics::Sprite &, const PropertyList &); + void ReadStats(battle::Stats &, const PropertyList &); private: const ParsedSource &source; - std::vector monsters; + std::set parsedDefinitions; + + std::map animations; + std::map heroes; + std::map monsters; + std::map numbers; + std::map sprites; };