Changeset 8720
- Timestamp:
- Jun 30, 2011, 8:30:13 PM (13 years ago)
- Location:
- code/branches/ai/src/orxonox/controllers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ai/src/orxonox/controllers/AIController.cc
r8711 r8720 208 208 if (!this->isActive()) 209 209 return; 210 210 //Vector-implementation: if(target_.size() == 0) target[0] = DEFAULT; 211 211 if(this->mode_ == DEFAULT) 212 { 212 {//Vector-implementation: mode_.back() == DEFAULT; 213 213 if (this->state_ == MASTER) 214 214 { … … 271 271 }//END_OF DEFAULT MODE 272 272 else if (this->mode_ == ROCKET)//Rockets do not belong to a group of bots -> bot states are not relevant. 273 { 273 { //Vector-implementation: mode_.back() == ROCKET; 274 274 ControllableEntity *controllable = this->getControllableEntity(); 275 275 if(controllable) -
code/branches/ai/src/orxonox/controllers/ArtificialController.cc
r8719 r8720 91 91 this->numberOfWeapons = 0; 92 92 this->botlevel_ = 1.0f; 93 this->mode_ = DEFAULT; 93 this->mode_ = DEFAULT;////Vector-implementation: mode_.push_back(DEFAULT); 94 94 this->timeout_=0; 95 95 } … … 98 98 { 99 99 if (this->isInitialized()) 100 { 100 {//Vector-implementation: mode_.erase(mode_.begin(),mode_.end()); 101 101 this->removeFromFormation(); 102 102 … … 1046 1046 {//ROCKET: mid range weapon 1047 1047 //TODO: Which weapon is the rocket? How many rockets are available? 1048 this->mode_ = ROCKET; 1048 this->mode_ = ROCKET;//Vector-implementation: mode_.push_back(ROCKET); 1049 1049 this->getControllableEntity()->fire(3);//launch rocket 1050 1050 if(this->getControllableEntity()&&this->target_)//after fire(3) getControllableEntity() refers to the rocket! … … 1081 1081 else if(wpn=="LaserMunition")//other munitiontypes are not defined yet :-( 1082 1082 weapons[0]=0; 1083 else if(wpn==" LENSFLARE")//TODO: insert right munition name1083 else if(wpn=="FusionMunition") 1084 1084 weapons[1]=1; 1085 else if(wpn==" SIMPLEROCKET")//TODO: insert right munition name1085 else if(wpn=="TargetSeeking Rockets") 1086 1086 weapons[2]=2; 1087 1087 else if(wpn=="ROCKET")//TODO: insert right munition name … … 1133 1133 void ArtificialController::setPreviousMode() 1134 1134 { 1135 this->mode_ = DEFAULT; 1135 this->mode_ = DEFAULT; //Vector-implementation: mode_.pop_back(); 1136 1136 } 1137 1137 -
code/branches/ai/src/orxonox/controllers/ArtificialController.h
r8719 r8720 146 146 bool bShooting_; 147 147 148 int numberOfWeapons; //< Used for weapon init function. Displayes number of weapons available for a bot.148 int numberOfWeapons; //< Used for weapon init function. Displayes number of weapons available for a bot. 149 149 int weapons[WeaponSystem::MAX_WEAPON_MODES]; 150 150 int projectiles[WeaponSystem::MAX_WEAPON_MODES]; … … 153 153 154 154 enum Mode {DEFAULT, ROCKET, DEFENCE, MOVING};//TODO; implement DEFENCE, MOVING modes 155 Mode mode_; 155 Mode mode_; //TODO: replace single value with stack-like implementation: std::vector<Mode> mode_; 156 156 void setPreviousMode(); 157 157
Note: See TracChangeset
for help on using the changeset viewer.