Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8208 in orxonox.OLD


Ignore:
Timestamp:
Jun 7, 2006, 6:42:28 PM (18 years ago)
Author:
snellen
Message:

added reset function to script manager

Location:
branches/script_engine/src/lib/script_engine
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/script_engine/src/lib/script_engine/script_manager.cc

    r8206 r8208  
    4444}
    4545
     46void  ScriptManager::reset()
     47{
     48  //TODO: delete all scripts and triggers, empty lists.
     49
     50
     51
     52}
    4653
    4754void ScriptManager::init()
  • branches/script_engine/src/lib/script_engine/script_manager.h

    r8206 r8208  
    1919  inline static ScriptManager* getInstance() { if (!ScriptManager::singletonRef)ScriptManager::singletonRef = new ScriptManager(); return ScriptManager::singletonRef; }
    2020
     21  /// LOADING
    2122  virtual void loadParams(const TiXmlElement* root);
    22 
     23 
     24  /// QUERRYING
    2325  Script* getScriptByFile(std::string& file);
    24 
     26 
    2527
    2628 
    2729 private:
    2830
     31   void  reset();                                   //!< Resets the script manager
    2932   void  init();
    3033   void  createScripts(const TiXmlElement* scripts);
     
    3639   static ScriptManager*             singletonRef;   //!< Reference to this class
    3740
    38    const std::list<BaseObject*>*     triggers;
     41   const std::list<BaseObject*>*     triggers;       //!< A list of all the triggers in the world
    3942
    40    const std::list<BaseObject*>*     scripts;
     43   const std::list<BaseObject*>*     scripts;        //!< A list of all the scripts in the world
    4144
    4245
  • branches/script_engine/src/lib/script_engine/script_trigger.cc

    r8207 r8208  
    4444        .defaultValues("");
    4545    LoadParam(root, "triggerparent", this, ScriptTrigger, setTriggerParent)
    46         .describe("The name of the target as it is in the *.oxw file")
     46        .describe("The name of the parent as it is in the *.oxw file")
    4747        .defaultValues("");
    4848
  • branches/script_engine/src/lib/script_engine/script_trigger.h

    r8207 r8208  
    1919   
    2020   
    21     ///
     21    /// DO WORK
    2222    virtual void tick(float timestep);
    2323    virtual void executeAction();
    2424
    25    
     25    /// SET MEMBER
    2626    void setTarget(const std::string& targetName);
    2727    void setTarget(WorldEntity* target) { if(target!=NULL) this->target=target; }
    28    
    2928    void setTriggerParent(const std::string& name);
    30  
    31     void setCallOnce(const bool call) { this->callOnce = call;}
    32     void setRadius(const float radius) { if(radius>0) this->radius = radius;}
    33     void setDelay(const float time){if(delay>0) this->delay = delay;}
    34     void setScript(const std::string& script){this->scriptFile = script;}
    35     void setFunction(const std::string& function){this->functionName = function;}
     29    void setCallOnce(const bool call) { this->callOnce = call; }
     30    void setRadius(const float radius) { if(radius>0) this->radius = radius; }
     31    void setDelay(const float time){if(delay>0) this->delay = delay; }
     32    void setScript(const std::string& script){ this->scriptFile = script; }
     33    void setFunction(const std::string& function){ this->functionName = function; }
     34
    3635
    3736  private:
     
    4443    std::string  functionName;
    4544
    46    
     45    //for internal use
    4746    bool         scriptCalled;
    4847    bool         callScript;
Note: See TracChangeset for help on using the changeset viewer.