]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Interpreter.h
switched to static type IDs
[l2e.git] / src / loader / Interpreter.h
index 15cebd5e2ff3f10e2adb57a48418c4efb1d1edf5..e78de126c2f70dac5483ad6f182b123f6319c0db 100644 (file)
@@ -31,6 +31,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 +76,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 +89,11 @@ 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 *> &);
+       void ReadScriptAddress(const ScriptToken &t, unsigned char *dest);
+       void ReadScriptInteger(const ScriptToken &t, unsigned char *dest);
+       void ReadScriptVector(const ScriptToken &t, unsigned char *dest);
 
        SDL_Surface *GetImage(const std::string &);