]> git.localhorst.tv Git - l2e.git/blobdiff - src/common/ScriptRunner.h
removed useless comments
[l2e.git] / src / common / ScriptRunner.h
index 9b0f1ac8aa037503bdce31580a2e4ae617512b96..7ee5b836c5d3472fec84eaf65f8d9420853f2eb7 100644 (file)
@@ -1,15 +1,12 @@
-/*
- * ScriptRunner.h
- *
- *  Created on: Oct 13, 2012
- *      Author: holy
- */
-
 #ifndef COMMON_SCRIPTRUNNER_H_
 #define COMMON_SCRIPTRUNNER_H_
 
-#include "fwd.h"
-#include "../geometry/Vector.h"
+namespace common {
+       class ScriptHost;
+}
+
+#include "Script.h"
+#include "../math/Vector.h"
 
 #include <SDL.h>
 
@@ -25,20 +22,18 @@ public:
        void Run(ScriptHost &, const Script &);
        bool Running() const;
 
-       void *Address0() const { return address0; }
-       void *Address1() const { return address1; }
-       int Integer0() const { return integer0; }
-       int Integer1() const { return integer1; }
-       const geometry::Vector<int> &Vector0() const { return vector0; }
-       const geometry::Vector<int> &Vector1() const { return vector1; }
+       void *AddressRegister(int n) const { return address[n]; }
+       int IntegerRegister(int n) const { return integer[n]; }
+       const math::Vector<int> &VectorRegister(int n) const { return vector[n]; }
 
 private:
        void Reset();
-       void Exec(unsigned char code);
+       void Exec(Script::Code code);
 
        void *PopAddress();
+       Script::Code PopCode();
        int PopInt();
-       const geometry::Vector<int> &PopVector();
+       const math::Vector<int> &PopVector();
 
        void Compare(int, int);
 
@@ -53,12 +48,10 @@ private:
        const Script *script;
        int cursor;
 
-       void *address0;
-       void *address1;
-       int integer0;
-       int integer1;
-       geometry::Vector<int> vector0;
-       geometry::Vector<int> vector1;
+       static const int numRegisters = 7;
+       void *address[numRegisters];
+       int integer[numRegisters];
+       math::Vector<int> vector[numRegisters];
 
        Uint8 compare;
 
@@ -66,4 +59,4 @@ private:
 
 }
 
-#endif /* COMMON_SCRIPTRUNNER_H_ */
+#endif