Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 23, 2006, 12:43:25 AM (19 years ago)
Author:
bensch
Message:

orxonox/new_class_id: some thoughts on a BaseIterator class, that can travers through ObejectLists without knowing the Polymorph type.
This is all virtual, and since templated virutal functions are not allowed, quite hard to implements…
hpe it will work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/script_engine/script.cc

    r9298 r9692  
    2424
    2525#include "class_list.h"
    26 CREATE_SCRIPTABLE_CLASS(Script, CL_SCRIPT,
     26CREATE_SCRIPTABLE_CLASS(Script, Script::classID(),
    2727                    addMethod("addObject", ExecutorLua2<Script,const std::string&, const std::string& >(&Script::addObject))
    2828                    ->addMethod("registerClass", ExecutorLua1<Script,const std::string&>(&Script::registerClass))
     
    3131                     );
    3232
     33NewObjectListDefinition(Script);
     34
    3335Script::Script(const TiXmlElement* root)
    3436{
    35   this->setClassID(CL_SCRIPT, "Script");
     37  this->registerObject(this, Script::_objectList);
    3638
    3739  returnCount = argumentCount = 0;
     
    6466  luaopen_math(luaState);
    6567  luaopen_debug(luaState);
    66  
     68
    6769  this->loadFile(filename);
    6870
     
    100102   std::string filedest(ResourceManager::getInstance()->getDataDir());
    101103   filedest += "scripts/" + filename;
    102    
     104
    103105   this->addThisScript();
    104106   this->registerStandartClasses();
    105    
     107
    106108   if(currentFile.length() != 0)
    107109   {
     
    295297       lua_remove(luaState,-1*returnCount);
    296298       returnCount--;
    297        
     299
    298300     }
    299301   }
     
    375377 {
    376378   bool success = false;
    377    
     379
    378380   //this->registerClass(std::string("Vector"));
    379381    this->registerClass("ScriptTrigger");
     
    382384   return success;
    383385 }
    384  
    385  
     386
     387
    386388 void Script::registerClass( const std::string& className)
    387389 {
     
    400402     }
    401403   }
    402  
     404
    403405 }
    404406
Note: See TracChangeset for help on using the changeset viewer.