Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7486 in orxonox.OLD


Ignore:
Timestamp:
May 2, 2006, 11:44:10 PM (18 years ago)
Author:
patrick
Message:

orxonox: kill event redesigned

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/defs/class_id.h

    r7482 r7486  
    149149
    150150  CL_KILL_TARGET                =    0x00105001,
    151 #warning new classid entry
    152   CL_KILL                       =    0x00105005,                  //FIXME: Bensch, this is actualy a BaseObject no idea where to put
    153151
    154152
  • trunk/src/util/game_rules.h

    r7483 r7486  
    3333    /** adding an mission goal to the game rules @param missionGoal the mission goal to add */
    3434    inline void addMissionGoal(MissionGoal* missionGoal) { this->missionList.push_back(missionGoal); }
    35 
    36     inline void registerKill(const Kill& kill) { /*this->killList.push_back(kill);*/ }
     35    /** adding a kill event to the kill list @param kill the kill object containing all infos */
     36    inline void registerKill(const Kill& kill) { this->killList.push_back(kill); }
    3737
    3838    virtual void onPlayerSpawn() {}
     
    5454    std::vector<MissionGoal*>   missionList;            //!< list of mission goals
    5555
    56     const std::vector<Kill>          killList;               //!<  list of kills in the world
     56    std::vector<Kill>          killList;               //!<  list of kills in the world
    5757};
    5858
  • trunk/src/util/kill.cc

    r7482 r7486  
    2222
    2323
    24 /**
    25  * standard constructor
    26  */
    27 Kill::Kill (WorldEntity* killer, WorldEntity* victim)
    28 {
    29   this->setClassID(CL_KILL, "Kill");
    30 
    31   this->killer = killer;
    32   this->victim = victim;
    33 }
    34 
    35 
    36 /**
    37  * standard constructor
    38  */
    39 Kill::Kill (WorldEntity* killer, Playable* victim)
    40 {
    41   this->setClassID(CL_KILL, "Kill");
    42 
    43   this->killer = killer;
    44   this->victim = (WorldEntity*)victim;
    45 }
    46 
    47 
    48 /**
    49  * standard deconstructor
    50 */
    51 Kill::~Kill ()
    52 {
    53   // delete what has to be deleted here
    54 }
  • trunk/src/util/kill.h

    r7482 r7486  
    1515
    1616//! A representing a kill event
    17 class Kill : public BaseObject
     17class Kill
    1818{
    1919
    2020  public:
    21     Kill(WorldEntity* killer, WorldEntity* victim);
    22     Kill(WorldEntity* killer, Playable* victim);
    23     virtual ~Kill();
     21    Kill(WorldEntity* killer, WorldEntity* victim) {  this->killer = killer; this->victim = victim; }
     22    Kill(WorldEntity* killer, Playable* victim) {this->killer = killer; this->victim = (WorldEntity*)victim;}
     23    virtual ~Kill() {}
    2424
    2525    /** @returns reference to the killer world entity, does not need to exist */
    26     inline WorldEntity* getKiller() { return this->killer; }
     26    inline WorldEntity* getKiller() const { return this->killer; }
    2727    /** @returns reference to the victim world entity, does not need to exist */
    28     inline WorldEntity* getVictim() { return this->victim; }
     28    inline WorldEntity* getVictim() const { return this->victim; }
    2929
    3030  private:
Note: See TracChangeset for help on using the changeset viewer.