- Timestamp:
- Dec 8, 2011, 6:07:32 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
r8959 r8968 29 29 #include "SpaceRace.h" 30 30 31 //#include "SpaceRaceManager.h"32 31 33 32 #include "items/Engine.h" … … 100 99 void SpaceRace::start() 101 100 { 102 //Gametype::start(); 103 this->spawnPlayersIfRequested(); Gametype::checkStart(); 101 102 this->spawnPlayersIfRequested(); 103 104 Gametype::checkStart(); 104 105 this->cantMove_=true; 105 106 … … 142 143 143 144 } 144 // for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) 145 // {if(this->getCheckpointReached(it->first)==-1) orxout()<<"index -1"<<endl;} 145 146 146 147 147 } 148 148 149 void SpaceRace::setV(SpaceRaceManager* m){/* 150 Vector3 v =Vector3(0,0,0); 151 int j=0; 152 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) 153 { 154 j=this->getCheckpointReached(it->first); 155 RaceCheckPoint* r=m->getCheckpoint(j); 156 v=r->getNextcheckpoint(); 157 for(int i=1;i<4;i++){ 158 if(v[i]==0){ 159 RaceCheckPoint* n=m->getCheckpoint(v[i]); 160 n->setV(true); 161 }} 162 }*/ 163 } 164 149 150 165 151 void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl) 166 {/* 167 this->checkpointReached_[pl]=index;152 { 153 this->checkpointReached_[pl]=index; 168 154 this->clock_.capture(); 169 int s = this->clock_.getSeconds();155 int s = this->clock_.getSeconds(); 170 156 int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s); 171 const std::string& message = "Checkpoint " + multi_cast<std::string>(index)157 const std::string& message = "Checkpoint " + multi_cast<std::string>(index) 172 158 + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) 173 + " seconds.";159 + " seconds."; 174 160 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 175 161 ChatManager::message(message); 176 */ 177 178 } 179 162 163 } 164 180 165 void SpaceRace::newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl) 181 {int index = p->getCheckpointIndex();182 this->checkpointReached_[pl]=index;183 this->clock_.capture();184 int s = this->clock_.getSeconds();185 int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s);166 { int index = p->getCheckpointIndex(); 167 this->checkpointReached_[pl]=index; 168 this->clock_.capture(); 169 int s = this->clock_.getSeconds(); 170 int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s); 186 171 const std::string& message = "Checkpoint " + multi_cast<std::string>(index) 187 + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)172 + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) 188 173 + " seconds."; 189 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 190 ChatManager::message(message); 191 192 193 } 174 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 175 ChatManager::message(message); 176 177 178 } 179 194 180 195 181 … … 212 198 // return valid_player; 213 199 } 200 201 bool SpaceRace::allowPawnHit(Pawn* victim, Pawn* originator) 202 { 203 return false; 204 } 205 206 bool SpaceRace::allowPawnDamage(Pawn* victim, Pawn* originator) 207 { 208 return false; 209 } 210 211 bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator) 212 { 213 return false; 214 } 214 215 }
Note: See TracChangeset
for help on using the changeset viewer.