Changeset 11071 for code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (8 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc
r9667 r11071 152 152 int amountControlled2 = 0; 153 153 154 for ( std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it)155 { 156 if( (*it)->getState() == BaseState::ControlTeam1)154 for (TeamBaseMatchBase* base : this->bases_) 155 { 156 if(base->getState() == BaseState::ControlTeam1) 157 157 { 158 158 amountControlled++; 159 159 } 160 if( (*it)->getState() == BaseState::ControlTeam2)160 if(base->getState() == BaseState::ControlTeam2) 161 161 { 162 162 amountControlled2++; … … 187 187 } 188 188 189 for ( std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)190 { 191 if ( it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)189 for (const auto& mapEntry : this->teamnumbers_) 190 { 191 if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 192 192 continue; 193 193 194 if ( it->second == winningteam)195 this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID());194 if (mapEntry.second == winningteam) 195 this->gtinfo_->sendAnnounceMessage("You have won the match!", mapEntry.first->getClientID()); 196 196 else 197 this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID());197 this->gtinfo_->sendAnnounceMessage("You have lost the match!", mapEntry.first->getClientID()); 198 198 } 199 199 … … 238 238 int count = 0; 239 239 240 for ( std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it)241 { 242 if ( (*it)->getState() == BaseState::ControlTeam1 && team == 0)240 for (TeamBaseMatchBase* base : this->bases_) 241 { 242 if (base->getState() == BaseState::ControlTeam1 && team == 0) 243 243 count++; 244 if ( (*it)->getState() == BaseState::ControlTeam2 && team == 1)244 if (base->getState() == BaseState::ControlTeam2 && team == 1) 245 245 count++; 246 246 } … … 258 258 { 259 259 unsigned int i = 0; 260 for ( std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it)260 for (TeamBaseMatchBase* base : this->bases_) 261 261 { 262 262 i++; 263 263 if (i > index) 264 return (*it);265 } 266 return 0;264 return base; 265 } 266 return nullptr; 267 267 } 268 268
Note: See TracChangeset
for help on using the changeset viewer.