Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
May 1, 2006, 3:21:40 PM (19 years ago)
Author:
patrick
Message:

mission goals loadable

Location:
trunk/src/util
Files:
4 edited

Legend:

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

    r7461 r7462  
    4747  BaseObject::loadParams(root);
    4848
     49  PRINTF(0)("GameRules::loadParams(...) hit me\n");
    4950  LoadParamXML(root, "MissionGoal", this, GameRules, loadMissionGoal)
    5051      .describe("an XML-Element to load the missions from");
     
    5556void GameRules::loadMissionGoal(const TiXmlElement* root)
    5657{
     58  PRINTF(0)("Trying to load MissionGoals\n");
    5759  const TiXmlElement* element = root->FirstChildElement();
    5860  while( element != NULL)
     
    6163    PRINTF(2)("Adding Mission Goal:%s\n", element->Value());
    6264    BaseObject* created = Factory::fabricate(element);
    63     if (created != NULL && created->isA(CL_GAME_RULES))
     65    if (created != NULL /*&& created->isA(CL_GAME_RULES)*/)
    6466    {
    6567      MissionGoal* mg = dynamic_cast<MissionGoal*>(created);
  • trunk/src/util/kill_target.cc

    r7461 r7462  
    1818#include "kill_target.h"
    1919
     20#include "util/loading/factory.h"
     21
    2022using namespace std;
     23
     24CREATE_FACTORY(KillTarget, CL_KILL_TARGET);
    2125
    2226
     
    2933{
    3034  this->setClassID(CL_KILL_TARGET, "KillTarget");
    31 
    32   PRINTF(0)("Created a KillTarget Mission Goal <==================================\n");
    3335
    3436  if( root != NULL)
     
    4951{
    5052  MissionGoal::loadParams(root);
     53
     54  //   LoadParam(root, "death-penalty-timeout", this, SingleplayerShootemup, setDeathPenaltyTimeout)
     55//       .describe("sets the time in seconds a player has to wait for respawn");
    5156}
    5257
     
    5459MissionState KillTarget::checkMissionGoal()
    5560{}
     61
  • trunk/src/util/kill_target.h

    r7461 r7462  
    1515
    1616//! A class representing a mission goal to kill a specific amount of a specific object type
    17 class KillTarget : public MissionGoal {
     17class KillTarget : public MissionGoal
     18{
    1819
    19  public:
    20   KillTarget(const TiXmlElement* root);
    21   virtual ~KillTarget();
     20  public:
     21    KillTarget(const TiXmlElement* root);
     22    virtual ~KillTarget();
    2223
    23   virtual void loadParams(const TiXmlElement* root);
    24 
    25   virtual MissionState checkMissionGoal();
     24    virtual void loadParams(const TiXmlElement* root);
    2625
    2726
    28  protected:
     27    void setNumberOfKills( int kills) { this->numberOfKills = kills; }
     28    void setTartetClassID( int classID) { this->targetClassID = classID; }
    2929
     30
     31    virtual MissionState checkMissionGoal();
     32
     33
     34  private:
     35    int numberOfKills;                                                 //!< the amount of kills of this kind
     36    int targetClassID;                                                 //!< id of the target class
    3037};
    3138
  • trunk/src/util/singleplayer_shootemup.cc

    r7461 r7462  
    4141
    4242
     43
    4344/**
    4445 * constructor
     
    4849{
    4950  this->setClassID(CL_SINGLEPLAYER_SHOOTEMUP, "SingleplayerShootemup");
    50 
    51   PRINTF(0)("Created a SinglePlayer Shootemup game\n");
    5251
    5352  if( root != NULL)
Note: See TracChangeset for help on using the changeset viewer.