Changeset 9436 for code/branches/Racingbot/src
- Timestamp:
- Nov 5, 2012, 4:21:40 PM (12 years ago)
- Location:
- code/branches/Racingbot/src/modules/gametypes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.cc
r9432 r9436 29 29 #include "gametypes/SpaceRaceManager.h" 30 30 31 // Von SpaceRaceManager points einlesen 32 // Berechnungsklasse nextPoint zur verfuegung stellen 33 // ^- aufrufen ueber tick (if ob noetig) 31 // WEnn RAcer nach start erstellt wird fehler in Tick 32 // Fuer beide Spieler wird next point angezeigt 34 33 namespace orxonox 35 34 { … … 43 42 { 44 43 RegisterObject(SpaceRaceController); 45 46 44 std::vector<RaceCheckPoint*> checkpoints; 47 45 for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it!= ObjectList<SpaceRaceManager>::end(); ++it) … … 68 66 RaceCheckPoint* SpaceRaceController::nextPointFind(RaceCheckPoint* raceCheckpoint) 69 67 { 70 int distances[] = { -1, -1, -1 }; 68 int distances[] = 69 { -1, -1, -1}; 71 70 int temp_i = 0; 72 71 for (std::set<int>::iterator it =raceCheckpoint->getNextCheckpoints().begin(); it!= raceCheckpoint->getNextCheckpoints().end(); ++it) … … 103 102 { 104 103 if (currentRaceCheckpoint_ == NULL) // no Adjust possible 104 105 105 { 106 106 return nextRaceCheckpoint_; 107 107 } 108 108 if ((currentRaceCheckpoint_->getNextCheckpoints()).size() == 1) // no Adjust possible 109 109 110 { 110 111 return nextRaceCheckpoint_; … … 141 142 { 142 143 std::map<RaceCheckPoint*, int> * zaehler = new std::map< 143 144 RaceCheckPoint*, int>(); // counts how many times the checkpoit was reached (for simulation) 144 145 for (unsigned int i = 0; i < allCheckpoints.size(); i++) 145 146 { … … 203 204 void SpaceRaceController::tick(float dt) 204 205 { 206 if (this->getControllableEntity() == NULL || this->getControllableEntity()->getPlayer() == NULL ){orxout()<<this->getControllableEntity()<<endl; return;} 205 207 if (nextRaceCheckpoint_->playerWasHere(this->getControllableEntity()->getPlayer())) 206 208 {//Checkpoint erreicht -
code/branches/Racingbot/src/modules/gametypes/SpaceRaceManager.cc
r9432 r9436 145 145 146 146 RaceCheckPoint* oldCheckpoint = gametype->getCheckpointReached(player); // returns the last from player reached checkpoint 147 // % fixing 148 orxout() << "SpaceRaceManager.checkpointReached( "<<newCheckpoint->getCheckpointIndex() 149 <<", "<< player->isHumanPlayer() << endl; 150 // % end fixing 147 151 148 if (this->reachedValidCheckpoint(oldCheckpoint, newCheckpoint, player)) 152 149 {
Note: See TracChangeset
for help on using the changeset viewer.