Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7463 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
May 1, 2006, 4:03:01 PM (19 years ago)
Author:
patrick
Message:

mission goals now get loaded correctly with all attributes

Location:
trunk/src/util
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/kill_target.cc

    r7462 r7463  
    1919
    2020#include "util/loading/factory.h"
     21#include "util/loading/load_param.h"
    2122
    2223using namespace std;
     
    5253  MissionGoal::loadParams(root);
    5354
    54   //   LoadParam(root, "death-penalty-timeout", this, SingleplayerShootemup, setDeathPenaltyTimeout)
    55 //       .describe("sets the time in seconds a player has to wait for respawn");
     55  LoadParam(root, "numberofkills", this, KillTarget, setNumberOfKills)
     56       .describe("sets the number of kills a target has to be killed");
     57  LoadParam(root, "targetclassid", this, KillTarget, setTargetClassID)
     58      .describe("sets the targets class id");
    5659}
    5760
  • trunk/src/util/kill_target.h

    r7462 r7463  
    2626
    2727    void setNumberOfKills( int kills) { this->numberOfKills = kills; }
    28     void setTartetClassID( int classID) { this->targetClassID = classID; }
     28    void setTargetClassID( int classID) { this->targetClassID = classID; }
     29    void setTargetClassName( char* className) {}
    2930
    3031
  • trunk/src/util/mission_goal.cc

    r7461 r7463  
    1717
    1818#include "mission_goal.h"
     19
     20#include "util/loading/load_param.h"
    1921
    2022using namespace std;
     
    4244}
    4345
    44 
     46/**
     47 * loading parameter function: more help on the wiki pages
     48 */
    4549void MissionGoal::loadParams(const TiXmlElement* root)
    4650{
    4751  BaseObject::loadParams(root);
     52
     53  LoadParam(root, "title", this, MissionGoal, setMissionName)
     54      .describe("sets the title of the mission");
     55  LoadParam(root, "description", this, MissionGoal, setMissionDescription)
     56      .describe("sets the mission description");
    4857}
     58
  • trunk/src/util/mission_goal.h

    r7461 r7463  
    3232  virtual void loadParams(const TiXmlElement* root);
    3333
     34  /** sets the mission name @param missionName: the string containig the mission title */
     35  inline void setMissionName(const std::string& missionName) { this->missionName = missionName; }
     36  /** @return the mission title */
     37  inline std::string getMissionName() { return this->missionName; }
     38
    3439  /** sets the mission description @param descrtiption: the string containing the description */
    35   inline void setMissionDescription(std::string description) { this->missionDescription = description; }
     40  inline void setMissionDescription(const std::string& description) { this->missionDescription = description; }
    3641  /** gets the mission description @returns the string containing the description */
    3742  inline std::string getMissionDescription() { return this->missionDescription; }
     43
     44  /** sets the mission state @param missionState  state of the mission*/
     45  inline void setMissionState(MissionState state) { this->missionState = state; }
     46  /** @returns the current mission state */
     47  inline MissionState getMissionState() { return this->missionState; }
    3848
    3949  virtual MissionState checkMissionGoal() = 0;
     
    4151
    4252 protected:
     53   std::string      missionName;                                           //!< the title of the mission
    4354   // perhaps there will be more than one description soon: a long and short version for different parsts in the gui
    4455   std::string      missionDescription;                                    //!< the text description of the mission
Note: See TracChangeset for help on using the changeset viewer.