Changeset 7653 in orxonox.OLD for branches/script_engine/src/lib/script_engine/Script.h
- Timestamp:
- May 17, 2006, 7:55:59 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/script_engine/src/lib/script_engine/Script.h
r7645 r7653 8 8 #include "scriptable.h" 9 9 10 namespace OrxScript 11 { 10 12 11 struct Scrptbl12 {13 Scriptable* scriptable;14 int scriptableRef;15 };13 struct Scrptbl 14 { 15 Scriptable* scriptable; 16 int scriptableRef; 17 }; 16 18 17 class LuaScript18 {19 class LuaScript 20 { 19 21 public: 20 22 LuaScript (); … … 26 28 /* ------------------ Script related Functions ------------------ */ 27 29 28 // Compile script into Virtual Machine30 // Compile script into Virtual Machine 29 31 bool compileFile (const std::string& strFilename); 30 32 bool compileBuffer (unsigned char *pbBuffer, size_t szLen); 31 33 32 // Register function with Lua in the this table34 // Register function with Lua in the this table 33 35 int registerFunction (const std::string& strFuncName); 34 36 35 37 36 // Selects a Lua Script function to call38 // Selects a Lua Script function to call 37 39 bool selectScriptFunction (const std::string& strFuncName); 38 40 void addParam (int iInt); … … 40 42 void addParam (char *string); 41 43 42 // Runs the loaded script44 // Runs the loaded script 43 45 bool run (int nReturns = 0); 44 46 45 // Checks on Virtual Machine script47 // Checks on Virtual Machine script 46 48 bool scriptHasFunction (const std::string& strScriptName); 47 49 48 // Method indexing check50 // Method indexing check 49 51 int methods (void) { return methodCount; } 50 52 51 53 52 // When the script calls a class method, this is called54 // When the script calls a class method, this is called 53 55 virtual int scriptCalling (LuaVirtualMachine& vm, int iFunctionNumber) = 0; 54 56 55 // When the script function has returns57 // When the script function has returns 56 58 virtual void handleReturns (LuaVirtualMachine& vm, const std::string& strFunc) = 0; 57 59 … … 60 62 /* ------------------- Handle external Objects ------------------ */ 61 63 62 void removeFromScript(int referenceToScriptable){}63 int addScriptableToScript(Scriptable* scriptbl,const std::string& name); // name= name the scriptable goes by in lua64 int addFunctionToScriptable(const std::string& strFuncName, int toScriptable, int lastMethodIndex);64 void removeFromScript(int referenceToScriptable){} 65 int addScriptableToScript(Scriptable* scriptbl,const std::string& name); // name= name the scriptable goes by in lua 66 int addFunctionToScriptable(const std::string& strFuncName, int toScriptable, int lastMethodIndex); 65 67 66 //Handle the Scriptable List67 Scriptable* getScriptableByReference(int scrptblRef);68 int getReferenceByScriptable(Scriptable* scriptable);69 bool addScriptableToList(Scriptable* scriptbl, int scriptableRef);70 bool removeScriptableFromList(Scriptable* scriptable);71 bool removeScriptableFromList(int scriptable);68 //Handle the Scriptable List 69 Scriptable* getScriptableByReference(int scrptblRef); 70 int getReferenceByScriptable(Scriptable* scriptable); 71 bool addScriptableToList(Scriptable* scriptbl, int scriptableRef); 72 bool removeScriptableFromList(Scriptable* scriptable); 73 bool removeScriptableFromList(int scriptable); 72 74 73 75 … … 85 87 std::string functionName; 86 88 std::list<Scrptbl> scriptableList; 87 };89 }; 88 90 91 } 89 92 90 93 #endif // __LUA_SCRIPT_BASE_H__
Note: See TracChangeset
for help on using the changeset viewer.