Changeset 9621 for code/branches/formationupdate/src/orxonox/worldentities
- Timestamp:
- May 7, 2013, 3:58:33 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc
r9620 r9621 309 309 310 310 311 /* Two functions to find the slaves of a Pawn 312 * 313 */ 311 // A function to check if this pawn's controller is the master of any formationcontroller 314 312 bool Pawn::hasSlaves() 315 313 { … … 318 316 it != ObjectList<FormationController>::end(); ++it ) 319 317 { 320 // checks if the Pawnhas a slave318 // checks if the pawn's controller has a slave 321 319 if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController()) 322 320 return true; … … 325 323 } 326 324 325 // A function that returns a slave of the pawn's controller 327 326 Controller* Pawn::getSlave(){ 328 327 for (ObjectList<FormationController>::iterator it = … … 331 330 { 332 331 if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController()) 333 return it->get This();332 return it->getController(); 334 333 } 335 334 return 0; … … 353 352 if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this) 354 353 { 355 356 // Do different things if Pawn is the Master of a Formation 354 // Start to control a new entity if you're the master of a formation 357 355 if(this->hasSlaves()) 358 356 { … … 363 361 slave->setControllableEntity(0); 364 362 365 366 // set new Master 363 // set a new master within the formation 367 364 orxonox_cast<FormationController*>(this->getController())->setNewMasterWithinFormation(orxonox_cast<FormationController*>(slave)); 368 //orxonox_cast<FormationController*>(this->getController())->setNewMasterWithinFormation();369 370 371 /* TO DO: - setNewMasterWithinFormation() with an argument.372 * - set slave as the new master within the formation373 *374 */375 365 376 366 // start to control a slave 377 367 this->getPlayer()->startControl(entity); 378 379 380 368 } 381 369 else
Note: See TracChangeset
for help on using the changeset viewer.