Changeset 7097
- Timestamp:
- Jun 3, 2010, 12:39:55 AM (14 years ago)
- Location:
- code/branches/presentation3/src/orxonox/controllers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/orxonox/controllers/ArtificialController.cc
r7090 r7097 95 95 96 96 XMLPortParam(ArtificialController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1); 97 XMLPortParam(ArtificialController, "formationFlight", setFormationFlight, getFormationFlight, xmlelement, mode).defaultValues( true);97 XMLPortParam(ArtificialController, "formationFlight", setFormationFlight, getFormationFlight, xmlelement, mode).defaultValues(false); 98 98 XMLPortParam(ArtificialController, "formationSize", setFormationSize, getFormationSize, xmlelement, mode).defaultValues(STANDARD_MAX_FORMATION_SIZE); 99 XMLPortParam(ArtificialController, "passive", setPassive, getPassive, xmlelement, mode).defaultValues(false); 99 100 } 100 101 … … 109 110 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 110 111 { 111 if (!it->getController()) 112 continue; 113 114 ArtificialController *aiController = orxonox_cast<ArtificialController*>(it->getController()); 112 Controller* controller = 0; 113 114 if (it->getController()) 115 controller = it->getController(); 116 else if (it->getXMLController()) 117 controller = it->getXMLController(); 118 119 if (!controller) 120 continue; 121 122 ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller); 115 123 116 124 if(aiController) … … 134 142 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 135 143 { 136 if (!it->getController()) 137 continue; 138 139 ArtificialController *aiController = orxonox_cast<ArtificialController*>(it->getController()); 144 Controller* controller = 0; 145 146 if (it->getController()) 147 controller = it->getController(); 148 else if (it->getXMLController()) 149 controller = it->getXMLController(); 150 151 if (!controller) 152 continue; 153 154 ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller); 140 155 141 156 if(aiController && aiController->state_ == MASTER) … … 161 176 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 162 177 { 163 if (!it->getController()) 164 continue; 165 166 currentHumanController = orxonox_cast<NewHumanController*>(it->getController()); 178 Controller* controller = 0; 179 180 if (it->getController()) 181 controller = it->getController(); 182 else if (it->getXMLController()) 183 controller = it->getXMLController(); 184 185 if (!controller) 186 continue; 187 188 currentHumanController = orxonox_cast<NewHumanController*>(controller); 167 189 168 190 if(currentHumanController) humanPawn = *it; 169 191 170 ArtificialController *aiController = orxonox_cast<ArtificialController*>( it->getController());192 ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller); 171 193 172 194 if(aiController && aiController->state_ == MASTER) … … 202 224 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 203 225 { 204 if (!it->getController()) 205 continue; 206 207 ArtificialController *aiController = orxonox_cast<ArtificialController*>(it->getController()); 226 Controller* controller = 0; 227 228 if (it->getController()) 229 controller = it->getController(); 230 else if (it->getXMLController()) 231 controller = it->getXMLController(); 232 233 if (!controller) 234 continue; 235 236 ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller); 208 237 209 238 if(aiController) … … 223 252 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 224 253 { 225 if (!it->getController()) 226 continue; 227 228 ArtificialController *aiController = orxonox_cast<ArtificialController*>(it->getController()); 254 Controller* controller = 0; 255 256 if (it->getController()) 257 controller = it->getController(); 258 else if (it->getXMLController()) 259 controller = it->getXMLController(); 260 261 if (!controller) 262 continue; 263 264 ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller); 229 265 230 266 if(aiController) … … 356 392 357 393 //has it an ArtificialController? 358 if (!it->getController()) 394 Controller* controller = 0; 395 396 if (it->getController()) 397 controller = it->getController(); 398 else if (it->getXMLController()) 399 controller = it->getXMLController(); 400 401 if (!controller) 359 402 continue; 360 403 … … 365 408 teamSize++; 366 409 367 ArtificialController *newMaster = orxonox_cast<ArtificialController*>( it->getController());410 ArtificialController *newMaster = orxonox_cast<ArtificialController*>(controller); 368 411 369 412 //is it a master? -
code/branches/presentation3/src/orxonox/controllers/ArtificialController.h
r7066 r7097 64 64 inline int getFormationSize() const 65 65 { return this->maxFormationSize_; } 66 67 inline void setPassive(bool passive) 68 { this->passive_ = passive; } 69 inline bool getPassive() const 70 { return this->passive_; } 66 71 67 72 virtual void changedControllableEntity();
Note: See TracChangeset
for help on using the changeset viewer.