Changeset 9619
- Timestamp:
- Apr 30, 2013, 3:55:12 PM (12 years ago)
- Location:
- code/branches/formationupdate/src/orxonox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/formationupdate/src/orxonox/controllers/FormationController.cc
r9348 r9619 534 534 } 535 535 536 /* 537 void FormationController::setNewMasterWithinFormation(FormationController* newMaster) 538 { 539 if(this->state_ != MASTER) return; 540 541 if (!this->slaves_.empty()) 542 { 543 newMaster->state_ = MASTER; 544 newMaster->slaves_ = this->slaves_; 545 newMaster->myMaster_ = 0; 546 547 for(std::vector<FormationController*>::iterator it = newMaster->slaves_.begin(); it != newMaster->slaves_.end(); it++) 548 { 549 (*it)->myMaster_ = newMaster; 550 } 551 } 552 553 this->slaves_.clear(); 554 this->specificMasterAction_ = NONE; 555 this->state_ = FREE; 556 } 557 */ 558 536 559 537 560 /** -
code/branches/formationupdate/src/orxonox/controllers/FormationController.h
r9617 r9619 59 59 static void passivebehaviour(const bool passive); 60 60 static void formationsize(const int size); 61 void takeLeadOfFormation();62 void loseMasterState();61 void setNewMasterWithinFormation(); 62 //void setNewMasterWithinFormation(FormationController* newMaster); 63 63 64 64 inline void setFormationFlight(bool formation) … … 103 103 FormationController* getMaster( void ) { return myMaster_; } 104 104 FormationController* getThis( void ) { return this; } 105 FormationController* getSlave( void ) { return this->slaves_.back(); } 105 106 106 107 protected: … … 133 134 void searchNewMaster(); 134 135 void commandSlaves(); 135 void setNewMasterWithinFormation(); 136 void takeLeadOfFormation(); 137 void loseMasterState(); 136 138 137 139 void freeSlaves(); -
code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc
r9617 r9619 365 365 366 366 // set new Master 367 orxonox_cast<FormationController*>(this->getController())->loseMasterState();368 369 370 371 /* TO DO: - new Master is not set right372 * - The slave still has a AIController367 //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 formation 373 373 * 374 374 */ … … 377 377 this->getPlayer()->startControl(entity); 378 378 379 //orxonox_cast<FormationController*>(this->getController())->takeLeadOfFormation();380 379 381 380 }
Note: See TracChangeset
for help on using the changeset viewer.