]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Interpreter.h
removed lazy fwd headers
[l2e.git] / src / loader / Interpreter.h
index 15cebd5e2ff3f10e2adb57a48418c4efb1d1edf5..5f66c0f954e55243f018eb9065783359801e206b 100644 (file)
@@ -1,23 +1,9 @@
-/*
- * Interpreter.h
- *
- *  Created on: Aug 26, 2012
- *      Author: holy
- */
-
 #ifndef LOADER_INTERPRETER_H_
 #define LOADER_INTERPRETER_H_
 
-#include "fwd.h"
 #include "PagedAllocator.h"
 #include "ParsedSource.h"
-#include "TypeDescription.h"
-#include "../battle/fwd.h"
-#include "../common/fwd.h"
-#include "../geometry/Vector.h"
-#include "../graphics/Color.h"
-#include "../graphics/ComplexAnimation.h"
-#include "../graphics/fwd.h"
+#include "../common/Script.h"
 
 #include <map>
 #include <set>
@@ -31,6 +17,15 @@ namespace loader {
 class Interpreter {
 
 public:
+       static const int BOOLEAN_ID = 1;
+       static const int COLOR_ID = 2;
+       static const int IMAGE_ID = 3;
+       static const int NUMBER_ID = 4;
+       static const int PATH_ID = 5;
+       static const int SCRIPT_ID = 6;
+       static const int STRING_ID = 7;
+       static const int VECTOR_ID = 8;
+
        class Error: public std::runtime_error {
        public:
                Error(const std::string &msg) : std::runtime_error("interpreter error: " + msg) { }
@@ -67,7 +62,7 @@ public:
        };
 
        const std::set<std::string> &ExportedIdentifiers() const { return source.Exports(); }
-       const ParsedDefinition &GetDefinition(const std::string &identifier) const;
+       const ParsedDefinition &GetDefinition(const std::string &identifier);
        const std::map<std::string, SDL_Surface *> &Images() const { return imageCache; }
        const std::vector<PostponedDefinition> &PostponedDefinitions() const { return postponedDefinitions; }
        const std::map<int, std::vector<void *> > &Values() const { return values; }
@@ -80,6 +75,12 @@ private:
        void ReadLiteral(int typeId, int id, char *dest, const Literal &);
        void *GetObject(int typeId, const Value &value);
        void ReadObject(int typeId, int id, char *dest, const PropertyList &);
+       void ReadScript(const std::vector<ScriptToken *> &, common::Script *);
+       char *ReadScript(const std::vector<ScriptToken *> &);
+       common::Script::Code &CreateScriptCode(common::Script::Command c, char *dest);
+       void ReadScriptAddress(const ScriptToken &t, char *dest);
+       void ReadScriptInteger(const ScriptToken &t, char *dest);
+       void ReadScriptVector(const ScriptToken &t, char *dest);
 
        SDL_Surface *GetImage(const std::string &);