- Timestamp:
- Oct 31, 2015, 4:07:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/AI_HS15/src/orxonox/controllers/FleetController.cc
r10722 r10731 43 43 /* this->goalTarget_ = NULL; 44 44 this->goalProtect_ = NULL;*/ 45 this->nTicks_ = 0; 46 this->bTicked_ = false; 45 47 46 //this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&FleetController::action, this))); 48 47 } … … 63 62 { 64 63 65 /*if (nTicks_ == 30)66 {67 std::vector<WeakPtr<WingmanController> > wingmen;68 std::vector<WeakPtr<LeaderController> > leaders;69 70 //--------------------------Put all WingmanController's in a vector--------------------------71 for (ObjectList<WingmanController>::iterator it = ObjectList<WingmanController>::begin(); it; ++it)72 {73 74 75 if ((*it)->getTeam() == this->getTeam())76 {77 orxout(internal_error) << "ANOTHER SUCKER" << endl;78 wingmen.push_back(*it);79 }80 81 }82 //--------------------------Substitute half of WingmanController's with LeaderController--------------------------83 84 bool nowLeader = true;85 LeaderController* leader;86 87 for (std::vector<WeakPtr<WingmanController> >::iterator it = wingmen.begin() ; it != wingmen.end(); ++it)88 {89 if (nowLeader)90 {91 leader = new LeaderController(this->getContext());92 leader->setTeam(this->team_);93 94 (*it)->getControllableEntity()->setController(leader);95 leaders.push_back(leader);96 nowLeader = !nowLeader;97 orxout(internal_error) << "NEW SUCKER" << endl;98 99 }100 else101 {102 if (leader)103 {104 leader->setWingman(*it);105 nowLeader = !nowLeader;106 orxout(internal_error) << "I OWN THE SUCKER" << endl;107 108 }109 }110 }111 112 //--------------------------Substitute half of LeaderController's with DivisionController--------------------------113 bool nowDivision = true;114 DivisionController* division;115 116 for (std::vector<WeakPtr<LeaderController> >::iterator it = leaders.begin() ; it != leaders.end(); ++it)117 {118 if (nowDivision)119 {120 division = new DivisionController(this->getContext());121 division->setTeam(this->team_);122 123 (*it)->getControllableEntity()->setController(division);124 125 divisions_.push_back(division);126 127 nowDivision = !nowDivision;128 }129 else130 {131 if (division)132 {133 division->setLeader(*it);134 nowDivision = !nowDivision;135 }136 }137 }138 bTicked_ = true;139 nTicks_ += 1;140 }141 else if (!bTicked_)142 {143 nTicks_ += 1;144 145 }*/146 64 SUPER(FleetController, tick, dt); 147 65
Note: See TracChangeset
for help on using the changeset viewer.