Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9061 in orxonox.OLD for trunk/src/lib/script_engine/script.cc


Ignore:
Timestamp:
Jul 3, 2006, 6:39:10 PM (18 years ago)
Author:
patrick
Message:

merged the single_player branche to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/script_engine/script.cc

    r9003 r9061  
    2424
    2525#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 //                               ):
     26CREATE_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                     );
    3031
    3132Script::Script(const TiXmlElement* root)
     
    8182   filedest += "scripts/" + filename;
    8283   
     84   this->addThisScript();
     85   this->registerStandartClasses();
     86   
    8387   if(currentFile.length() != 0)
    8488   {
     
    97101     {
    98102      currentFile = filename;
    99       //this->addThisScript();
    100103      return true;
    101104     }
     
    119122 void Script::addObject(const std::string& className, const std::string& objectName)
    120123 {
    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());
    122125
    123126   BaseObject* scriptClass = ClassList::getObject(className, CL_SCRIPT_CLASS);
     
    163166 }
    164167
    165  bool Script::selectFunction(std::string& functionName, int retCount)
     168 bool Script::selectFunction(const std::string& functionName, int retCount)
    166169 {
    167170   if(returnCount == 0 && currentFunction.length() == 0) //no return values left on the stack and no other function selected
     
    356359   
    357360   //success = this->registerClass(std::string("Vector"));
    358    
     361    success = this->registerClass("ScriptTrigger");
     362
    359363   return success;
    360364 }
Note: See TracChangeset for help on using the changeset viewer.