Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9692 in orxonox.OLD for branches/new_class_id/src/lib/script_engine


Ignore:
Timestamp:
Aug 23, 2006, 12:43:25 AM (18 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

Location:
branches/new_class_id/src/lib/script_engine
Files:
3 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
  • branches/new_class_id/src/lib/script_engine/script.h

    r9298 r9692  
    2222class Script : public BaseObject
    2323{
     24  NewObjectListDeclaration(Script);
    2425  public:
    2526    Script(const TiXmlElement* root = NULL);
     
    3334    bool loadFile(const std::string& filename);
    3435    void addObject( const std::string& className,const std::string& objectName);
    35     void registerClass(const std::string& className);                           //!< Register a class but dont add any instances 
     36    void registerClass(const std::string& className);                           //!< Register a class but dont add any instances
    3637
    3738    /// QUERRYING
  • branches/new_class_id/src/lib/script_engine/script_class.cc

    r8711 r9692  
    1919#include <cassert>
    2020
     21NewObjectListDefinition(ScriptClass);
    2122/**
    2223 * @brief standard constructor
     
    2728{
    2829  assert(scriptMethods != NULL);
    29   this->setClassID(CL_SCRIPT_CLASS, "ScriptClass");
     30  this->registerObject(this, Shell::_objectList);
    3031
    3132  this->_classID = classID;
Note: See TracChangeset for help on using the changeset viewer.