X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FInterpreter.h;h=aea5fbe85712433c963cf5f1aeb8016f59fdbc0b;hb=8cd1fa19b3697a78579ae254933bdcf7345ba9ff;hp=2748c63bdadfa44e80539fca52d9517cb4636822;hpb=ebd72885587d606677e35129e418dbe6321082d1;p=l2e.git diff --git a/src/loader/Interpreter.h b/src/loader/Interpreter.h index 2748c63..aea5fbe 100644 --- a/src/loader/Interpreter.h +++ b/src/loader/Interpreter.h @@ -12,7 +12,6 @@ #include "../graphics/ComplexAnimation.h" #include -#include #include #include #include @@ -47,7 +46,7 @@ public: public: Interpreter(const ParsedSource &source) : source(source) { } - ~Interpreter() { } + ~Interpreter(); private: Interpreter(const Interpreter &); Interpreter &operator =(const Interpreter &); @@ -88,13 +87,31 @@ private: private: const ParsedSource &source; - std::set parsedDefinitions; - - std::map animations; - std::map heroes; - std::map monsters; - std::map numbers; - std::map sprites; + enum DynamicType { + ANIMATION, + COMPLEX_ANIMATION, + HERO, + MONSTER, + NUMBER, + SIMPLE_ANIMATION, + SPRITE, + }; + struct ParsedDefinition { + ParsedDefinition(const Definition *dfn, DynamicType type, int index) + : dfn(dfn), type(type), index(index) { } + bool IsCompatible(DynamicType with) const; + const Definition *dfn; + DynamicType type; + int index; + }; + std::map parsedDefinitions; + + std::vector animations; + std::vector heroes; + std::vector images; + std::vector monsters; + std::vector numbers; + std::vector sprites; };