Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 30, 2013, 3:55:12 PM (12 years ago)
Author:
maxima
Message:

New function SetNewMasterWithinFormation(FormationController), but it does not work yet.

Location:
code/branches/formationupdate/src/orxonox/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/formationupdate/src/orxonox/controllers/FormationController.cc

    r9348 r9619  
    534534    }
    535535
     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
    536559
    537560  /**
  • code/branches/formationupdate/src/orxonox/controllers/FormationController.h

    r9617 r9619  
    5959      static void passivebehaviour(const bool passive);
    6060      static void formationsize(const int size);
    61       void takeLeadOfFormation();
    62       void loseMasterState();
     61      void setNewMasterWithinFormation();
     62      //void setNewMasterWithinFormation(FormationController* newMaster);
    6363
    6464      inline void setFormationFlight(bool formation)
     
    103103      FormationController* getMaster( void ) { return myMaster_; }
    104104      FormationController* getThis( void ) { return this; }
     105      FormationController* getSlave( void ) { return this->slaves_.back(); }
    105106
    106107  protected:
     
    133134      void searchNewMaster();
    134135      void commandSlaves();
    135       void setNewMasterWithinFormation();
     136      void takeLeadOfFormation();
     137      void loseMasterState();
    136138
    137139      void freeSlaves();
Note: See TracChangeset for help on using the changeset viewer.