]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Interpreter.h
interpretation of Heros and Monsters
[l2e.git] / src / loader / Interpreter.h
index c2fc25f84b6a1b6cb09edf1492e046f1e13c50d2..9ba5924a8ab85173e4967c167cc6a62ac6139149 100644 (file)
@@ -8,13 +8,26 @@
 #ifndef LOADER_INTERPRETER_H_
 #define LOADER_INTERPRETER_H_
 
+#include "../geometry/Vector.h"
+#include "../graphics/ComplexAnimation.h"
+
 #include <map>
+#include <set>
 #include <stdexcept>
 #include <string>
 #include <vector>
+#include <SDL.h>
 
 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 {
 
@@ -42,14 +56,38 @@ public:
        void ReadSource();
 
 private:
+       void ReadDefinition(const Definition &);
        void ReadLiteral(const Definition &);
        void ReadObject(const Definition &);
 
+       graphics::Animation *GetAnimation(const Value &);
+       const std::vector<Value *> &GetValueArray(const Value &);
+       const std::vector<PropertyList *> &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<int> 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<battle::Monster> monsters;
+       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;
 
 };