Changeset 9727 in orxonox.OLD for branches/new_class_id/src/lib/script_engine
- Timestamp:
- Sep 14, 2006, 5:24:31 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib/script_engine
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/script_engine/lunar.h
r8408 r9727 16 16 userdataType; 17 17 public: 18 typedef Executor * mfp;18 typedef Executor<lua_State*>* mfp; 19 19 typedef struct { const char *name; mfp mfunc; } 20 20 RegType; … … 184 184 lua_remove(L, 1); // remove self so member function args start at index 1 185 185 // get member function from upvalue 186 Executor *l = static_cast<Executor*>(lua_touserdata(L, lua_upvalueindex(1))); 187 int value; 188 (*l)(obj, value, L); // call member function 189 return value; 186 mfp l = static_cast<mfp>(lua_touserdata(L, lua_upvalueindex(1))); 187 (*l)(obj, L); // call member function 188 return l->hasRetVal()? 1 : 0; 190 189 } 191 190 -
branches/new_class_id/src/lib/script_engine/script_manager.cc
r9715 r9727 27 27 #include "script_trigger.h" 28 28 #include "luaincl.h" 29 #include "loading/load_param.h" 30 #include "parser/tinyxml/tinyxml.h" 29 #include "loading/load_param_xml.h" 31 30 32 31 -
branches/new_class_id/src/lib/script_engine/script_method.cc
r8711 r9727 25 25 { } 26 26 27 ScriptMethod* ScriptMethod::addMethod(const std::string& methodName, const Executor & executor)27 ScriptMethod* ScriptMethod::addMethod(const std::string& methodName, const Executor<lua_State*>& executor) 28 28 { 29 29 this->methods.push_back(ScriptMethod::Method(methodName, executor)); … … 32 32 } 33 33 34 ScriptMethod::Method::Method(const std::string& name, const Executor & executor)34 ScriptMethod::Method::Method(const std::string& name, const Executor<lua_State*>& executor) 35 35 { 36 36 this->name = name; -
branches/new_class_id/src/lib/script_engine/script_method.h
r8711 r9727 18 18 ~ScriptMethod(); 19 19 20 ScriptMethod* addMethod(const std::string& methodName, const Executor & executor);20 ScriptMethod* addMethod(const std::string& methodName, const Executor<lua_State*>& executor); 21 21 22 22 unsigned int size() const { return methods.size(); }; 23 23 24 24 const std::string& name(unsigned int methodNumber) const { return methods[methodNumber].name; }; 25 const Executor * executor(unsigned int methodNumber) const { return methods[methodNumber].executor; };25 const Executor<lua_State*>* executor(unsigned int methodNumber) const { return methods[methodNumber].executor; }; 26 26 27 27 … … 29 29 struct Method 30 30 { 31 Method(const std::string& name, const Executor & executor);32 std::string name;33 Executor *executor;31 Method(const std::string& name, const Executor<lua_State*>& executor); 32 std::string name; 33 Executor<lua_State*>* executor; 34 34 }; 35 35
Note: See TracChangeset
for help on using the changeset viewer.