Changeset 9061 in orxonox.OLD for trunk/src/lib/script_engine
- Timestamp:
- Jul 3, 2006, 6:39:10 PM (19 years ago)
- Location:
- trunk/src/lib/script_engine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/script_engine/script.cc
r9003 r9061 24 24 25 25 #include "class_list.h" 26 // uncommet this when the std:string and the const bug is fixed 27 //CREATE_SCRIPTABLE_CLASS(Script, CL_SCRIPT, 28 // addMethod("addObject", ExecutorLua2<Script,std::string,std::string>(&Script::addObject)) 29 // ): 26 CREATE_SCRIPTABLE_CLASS(Script, CL_SCRIPT, 27 addMethod("addObject", ExecutorLua2<Script,const std::string&, const std::string& >(&Script::addObject)) 28 ->addMethod("selectFunction", ExecutorLua2ret<Script, bool, const std::string&, int >(&Script::selectFunction)) 29 ->addMethod("executeFunction", ExecutorLua0ret<Script,bool >(&Script::executeFunction)) 30 ); 30 31 31 32 Script::Script(const TiXmlElement* root) … … 81 82 filedest += "scripts/" + filename; 82 83 84 this->addThisScript(); 85 this->registerStandartClasses(); 86 83 87 if(currentFile.length() != 0) 84 88 { … … 97 101 { 98 102 currentFile = filename; 99 //this->addThisScript();100 103 return true; 101 104 } … … 119 122 void Script::addObject(const std::string& className, const std::string& objectName) 120 123 { 121 // printf("Script %p: I am about to add %s of class %s\n",this,objectName.c_str(),className.c_str());124 //printf("Script %s: I am about to add %s of class %s\n",this->getName(),objectName.c_str(),className.c_str()); 122 125 123 126 BaseObject* scriptClass = ClassList::getObject(className, CL_SCRIPT_CLASS); … … 163 166 } 164 167 165 bool Script::selectFunction( std::string& functionName, int retCount)168 bool Script::selectFunction(const std::string& functionName, int retCount) 166 169 { 167 170 if(returnCount == 0 && currentFunction.length() == 0) //no return values left on the stack and no other function selected … … 356 359 357 360 //success = this->registerClass(std::string("Vector")); 358 361 success = this->registerClass("ScriptTrigger"); 362 359 363 return success; 360 364 } -
trunk/src/lib/script_engine/script.h
r9003 r9061 42 42 /// EXECUTING 43 43 // first select function 44 bool selectFunction( std::string& functionName, int retCount);44 bool selectFunction(const std::string& functionName, int retCount); 45 45 46 46 // push parameters for luafunction
Note: See TracChangeset
for help on using the changeset viewer.