Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7462 in orxonox.OLD


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

mission goals loadable

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r7428 r7462  
    4040                \
    4141                util/multiplayer_team_deathmatch.cc \
     42                util/singleplayer_shootemup.cc \
     43                \
     44                util/kill_target.cc \
    4245                \
    4346                subprojects/benchmark.cc
  • trunk/src/lib/util/loading/factory.cc

    r7221 r7462  
    117117  if (factory != Factory::factoryList->end())
    118118  {
    119     PRINTF(4)("Create a new Object of type %s\n", (*factory)->getName());
     119    PRINTF(2)("Create a new Object of type %s\n", (*factory)->getName());
    120120    return (*factory)->fabricateObject(root);
    121121  }
  • trunk/src/story_entities/game_world_data.cc

    r7461 r7462  
    382382    PRINTF(2)("creating %s\n", element->Value());
    383383    BaseObject* created = Factory::fabricate(element);
    384     if (created != NULL && created->isA(CL_GAME_RULES))
     384    if (created != NULL /*&& created->isA(CL_GAME_RULES)*/)
    385385    {
    386386      this->gameRule = dynamic_cast<GameRules*>(created);
    387387      State::setGameRules(this->gameRule);
    388388      // if there is a valid game rule loaded, break because it is not thought to load multiple game rules
    389       break;
     389      return;
    390390    }
    391391    else
  • 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.