- Timestamp:
- Nov 30, 2011, 4:17:00 PM (13 years ago)
- Location:
- code/branches/spaceraceTwo/src/modules
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc
r8949 r8954 40 40 CreateFactory(RaceCheckPoint); 41 41 42 42 43 43 44 RaceCheckPoint::RaceCheckPoint(BaseObject* creator): Distance Trigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))44 RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceMultiTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this)) 45 45 { 46 46 RegisterObject(RaceCheckPoint); 47 47 this->setDistance(100); 48 this->setBeaconMode("off"); 49 this->setBroadcast(false); 50 this->setSimultaneousTriggerers(100); 48 51 49 52 … … 56 59 this->setRadarObjectShape(RadarViewable::Triangle); 57 60 this->setRadarVisibility(true); 61 62 //this->addTarget("WorldEntity"); 63 64 58 65 } 66 59 67 60 68 RaceCheckPoint::~RaceCheckPoint() 61 69 { 62 //if (this->isInitialized()) 70 71 if (this->isInitialized()) 63 72 { 64 73 //for (size_t i = 0; i < 3; ++i) … … 76 85 if(this->isVisible_){this->setRadarVisibility(true);} 77 86 else{this->setRadarVisibility(false);} 78 87 88 89 79 90 80 91 /*this->setRadarVisibility(false); … … 103 114 } 104 115 105 void RaceCheckPoint:: triggered(bool bIsTriggered, PlayerInfo* player)116 void RaceCheckPoint::fire(bool bIsTriggered,BaseObject* player) 106 117 { 107 DistanceTrigger::triggered(bIsTriggered); 118 119 //bool b= bIsTriggered; 120 //PlayerInfo* pl= player; 121 DistanceMultiTrigger::fire((bool)bIsTriggered,player); 122 123 //SUPER(RaceCheckPoint,fire,bIsTriggered,player); 124 108 125 109 126 SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get()); 110 127 assert(gametype); 111 if (gametype && this->getCheckpointIndex() == gametype->getCheckpointReached(player) && bIsTriggered) 128 129 PlayerInfo* player2 = (PlayerInfo*)player; 130 assert(player2); 131 //DistanceMultiTrigger::fire(bIsTriggered,player); 132 133 134 135 136 137 if (gametype && this->getCheckpointIndex() == gametype->getCheckpointReached(player2) && bIsTriggered) 112 138 { 113 139 gametype->clock_.capture(); … … 122 148 else 123 149 { 124 gametype->newCheckpointReached(this,player );150 gametype->newCheckpointReached(this,player2); 125 151 this->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red. 126 152 } -
code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h
r8940 r8954 32 32 #include "gametypes/GametypesPrereqs.h" 33 33 34 #include "objects/triggers/Distance Trigger.h"34 #include "objects/triggers/DistanceMultiTrigger.h" 35 35 #include "interfaces/RadarViewable.h" 36 36 … … 42 42 !!! Don't forget to control the indexes of your check points and to set one last check point!!! 43 43 */ 44 class _GametypesExport RaceCheckPoint : public Distance Trigger, public RadarViewable44 class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable 45 45 { 46 46 public: … … 65 65 {this->isVisible_ = b;} 66 66 protected: 67 virtual void triggered(bool bIsTriggered, PlayerInfo* player);67 virtual void fire(bool bIsTriggered,BaseObject* player); 68 68 inline void setLast(bool isLast) 69 69 { this->bIsLast_ = isLast; } -
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
r8949 r8954 117 117 118 118 this->addBots(this->numberOfBots_); 119 119 120 120 121 } -
code/branches/spaceraceTwo/src/modules/objects/triggers/DistanceMultiTrigger.h
r8706 r8954 91 91 @ingroup MultiTrigger 92 92 */ 93 class _ObjectsExport DistanceMultiTrigger : public MultiTrigger 93 class _ObjectsExport DistanceMultiTrigger : public MultiTrigger 94 94 { 95 95 -
code/branches/spaceraceTwo/src/modules/objects/triggers/MultiTrigger.h
r8457 r8954 157 157 bool isTriggered(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is triggered for a given object. 158 158 159 v oid fire(bool status, BaseObject* originator = NULL); //!< Helper method. Creates an Event for the given status and originator and fires it.159 virtual void fire(bool status, BaseObject* originator = NULL); //!< Helper method. Creates an Event for the given status and originator and fires it. 160 160 void broadcast(bool status); //!< Helper method. Broadcasts an Event for every object that is a target. 161 161
Note: See TracChangeset
for help on using the changeset viewer.