]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Interpreter.h
split complex and simple animations in interpreter
[l2e.git] / src / loader / Interpreter.h
index 2748c63bdadfa44e80539fca52d9517cb4636822..da0cb88de147c2725a6d846bf9782d76f69ca77f 100644 (file)
@@ -12,7 +12,6 @@
 #include "../graphics/ComplexAnimation.h"
 
 #include <map>
-#include <set>
 #include <stdexcept>
 #include <string>
 #include <vector>
@@ -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,30 @@ private:
 
 private:
        const ParsedSource &source;
-       std::set<std::string> parsedDefinitions;
-
-       std::map<std::string, graphics::Animation *> animations;
-       std::map<std::string, battle::Hero *> heroes;
-       std::map<std::string, battle::Monster *> monsters;
-       std::map<std::string, int> numbers;
-       std::map<std::string, graphics::Sprite *> sprites;
+       enum Type {
+               COMPLEX_ANIMATION,
+               HERO,
+               MONSTER,
+               NUMBER,
+               SIMPLE_ANIMATION,
+               SPRITE,
+       };
+       struct ParsedDefinition {
+               ParsedDefinition(const Definition *dfn, Type type, int index)
+               : dfn(dfn), type(type), index(index) { }
+               const Definition *dfn;
+               Type type;
+               int index;
+       };
+       std::map<std::string, ParsedDefinition> parsedDefinitions;
+
+       std::vector<graphics::ComplexAnimation *> complexAnimations;
+       std::vector<battle::Hero *> heroes;
+       std::vector<SDL_Surface *> images;
+       std::vector<battle::Monster *> monsters;
+       std::vector<int> numbers;
+       std::vector<graphics::SimpleAnimation *> simpleAnimations;
+       std::vector<graphics::Sprite *> sprites;
 
 };