Changeset 9617 for code/branches/formationupdate
- Timestamp:
- Apr 30, 2013, 3:12:11 PM (12 years ago)
- Location:
- code/branches/formationupdate/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/formationupdate/src/orxonox/controllers/Controller.h
r8706 r9617 65 65 virtual void changedControllableEntity() {} 66 66 67 protected:68 67 // don't use this directly, use getPlayer()->startControl(entity) (unless you know exactly what you do) 69 68 inline void setControllableEntity(ControllableEntity* entity) -
code/branches/formationupdate/src/orxonox/controllers/FormationController.h
r9616 r9617 60 60 static void formationsize(const int size); 61 61 void takeLeadOfFormation(); 62 void loseMasterState(); 62 63 63 64 inline void setFormationFlight(bool formation) … … 136 137 void freeSlaves(); 137 138 void forceFreeSlaves(); 138 void loseMasterState();139 139 void forceFreedom(); 140 140 bool forcedFree(); -
code/branches/formationupdate/src/orxonox/controllers/HumanController.h
r9256 r9617 102 102 //friend class, for mouselook 103 103 friend class Map; 104 static HumanController* localController_s; 104 105 105 106 protected: 106 static HumanController* localController_s;107 107 bool controlPaused_; 108 108 -
code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc
r9616 r9617 314 314 bool Pawn::hasSlaves() 315 315 { 316 316 for (ObjectList<FormationController>::iterator it = 317 317 ObjectList<FormationController>::begin(); 318 318 it != ObjectList<FormationController>::end(); ++it ) … … 327 327 Controller* Pawn::getSlave(){ 328 328 for (ObjectList<FormationController>::iterator it = 329 330 329 ObjectList<FormationController>::begin(); 330 it != ObjectList<FormationController>::end(); ++it ) 331 331 { 332 332 if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController()) … … 360 360 ControllableEntity* entity = slave->getControllableEntity(); 361 361 362 // delete the AIController 363 slave->setControllableEntity(0); 364 365 362 366 // set new Master 363 orxonox_cast<FormationController*>(slave)->takeLeadOfFormation(); 367 orxonox_cast<FormationController*>(this->getController())->loseMasterState(); 368 364 369 365 370 … … 368 373 * 369 374 */ 370 //slave->getPlayer()->stopControl();371 375 372 376 // start to control a slave 373 377 this->getPlayer()->startControl(entity); 378 379 //orxonox_cast<FormationController*>(this->getController())->takeLeadOfFormation(); 380 374 381 } 375 382 else
Note: See TracChangeset
for help on using the changeset viewer.