Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 31, 2006, 10:51:08 PM (18 years ago)
Author:
bensch
Message:

orxonox/branches/new_class_id: new_class ID working, adapdet many classes, and reinvented some of the ClassID stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/world_entities/script_trigger.cc

    r9656 r9709  
    1616
    1717#include "script_trigger.h"
    18 #include "class_list.h"
    1918#include "script.h"
    2019
    2120#include "state.h"
    2221
    23 
    24 CREATE_SCRIPTABLE_CLASS(ScriptTrigger, CL_SCRIPT_TRIGGER,
     22NewObjectListDefinition(ScriptTrigger);
     23
     24CREATE_SCRIPTABLE_CLASS(ScriptTrigger, ScriptTrigger::classID(),
    2525            // Coordinates
    2626             addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
     
    4949 */
    5050ScriptTrigger::ScriptTrigger(const TiXmlElement* root)
    51 { 
    52   this->setClassID(CL_SCRIPT_TRIGGER, "ScriptTrigger");
     51{
     52  this->registerObject(this, ScriptTrigger::_objectList);
    5353  this->toList(OM_COMMON);
    5454
     
    139139void ScriptTrigger::setTarget(const std::string& target)
    140140{
    141   BaseObject* targetEntity = ClassList::getObject(target, CL_WORLD_ENTITY);
    142 
     141
     142  WorldEntity* targetEntity = WorldEntity::objectList().getObject(target);
    143143  if (targetEntity != NULL)
    144144  {
    145     this->setTarget(dynamic_cast<WorldEntity*>(targetEntity));
     145    this->setTarget(targetEntity);
    146146  }
    147147  else
     
    157157void ScriptTrigger::setTriggerParent(const std::string& parent)
    158158{
    159   BaseObject* parentEntity = ClassList::getObject(parent, CL_WORLD_ENTITY);
     159  WorldEntity* parentEntity = WorldEntity::objectList().getObject(parent);
    160160
    161161  if (parentEntity != NULL)
    162162  {
    163     this->setParent(dynamic_cast<WorldEntity*>(parentEntity));
     163    this->setParent(parentEntity);
    164164    this->setParentMode(PNODE_MOVEMENT);
    165165  }
Note: See TracChangeset for help on using the changeset viewer.