[Orxonox-commit 4049] r8720 - code/branches/ai/src/orxonox/controllers

jo at orxonox.net jo at orxonox.net
Thu Jun 30 20:30:13 CEST 2011


Author: jo
Date: 2011-06-30 20:30:13 +0200 (Thu, 30 Jun 2011)
New Revision: 8720

Modified:
   code/branches/ai/src/orxonox/controllers/AIController.cc
   code/branches/ai/src/orxonox/controllers/ArtificialController.cc
   code/branches/ai/src/orxonox/controllers/ArtificialController.h
Log:
Just a backup, before starting to update the ai branch.

Modified: code/branches/ai/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/ai/src/orxonox/controllers/AIController.cc	2011-06-30 15:20:39 UTC (rev 8719)
+++ code/branches/ai/src/orxonox/controllers/AIController.cc	2011-06-30 18:30:13 UTC (rev 8720)
@@ -207,9 +207,9 @@
         
         if (!this->isActive())
             return;
-
+        //Vector-implementation: if(target_.size() == 0) target[0] = DEFAULT;
         if(this->mode_ == DEFAULT)
-	{
+	{//Vector-implementation: mode_.back() == DEFAULT;
             if (this->state_ == MASTER)
             {
                 if (this->specificMasterAction_ ==  NONE)
@@ -270,7 +270,7 @@
             }
         }//END_OF DEFAULT MODE
         else if (this->mode_ == ROCKET)//Rockets do not belong to a group of bots -> bot states are not relevant.
-        {   
+        {   //Vector-implementation: mode_.back() == ROCKET;
             ControllableEntity *controllable = this->getControllableEntity(); 
             if(controllable)
             {

Modified: code/branches/ai/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/ai/src/orxonox/controllers/ArtificialController.cc	2011-06-30 15:20:39 UTC (rev 8719)
+++ code/branches/ai/src/orxonox/controllers/ArtificialController.cc	2011-06-30 18:30:13 UTC (rev 8720)
@@ -90,14 +90,14 @@
         this->bSetupWorked = false;
         this->numberOfWeapons = 0;
         this->botlevel_ = 1.0f;
-        this->mode_ = DEFAULT;
+        this->mode_ = DEFAULT;////Vector-implementation: mode_.push_back(DEFAULT);
         this->timeout_=0;
     }
 
     ArtificialController::~ArtificialController()
     {
         if (this->isInitialized())
-        {
+        {//Vector-implementation: mode_.erase(mode_.begin(),mode_.end());
             this->removeFromFormation();
 
             for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it; ++it)
@@ -1045,7 +1045,7 @@
             else if((weapons[3]==3)&& this->isCloseAtTarget(400) /*&&projectiles[3]*/ )
             {//ROCKET: mid range weapon
                 //TODO: Which weapon is the rocket? How many rockets are available?
-                this->mode_ = ROCKET;
+                this->mode_ = ROCKET;//Vector-implementation: mode_.push_back(ROCKET);
                 this->getControllableEntity()->fire(3);//launch rocket
                 if(this->getControllableEntity()&&this->target_)//after fire(3) getControllableEntity() refers to the rocket!
                 {
@@ -1080,9 +1080,9 @@
                         weapons[i]=-1;
                     else if(wpn=="LaserMunition")//other munitiontypes are not defined yet :-(
                         weapons[0]=0;
-                    else if(wpn=="LENSFLARE")//TODO: insert right munition name
+                    else if(wpn=="FusionMunition")
                         weapons[1]=1;
-                    else if(wpn=="SIMPLEROCKET")//TODO: insert right munition name
+                    else if(wpn=="TargetSeeking Rockets")
                         weapons[2]=2;
                     else if(wpn=="ROCKET")//TODO: insert right munition name
                         weapons[3]=3;
@@ -1132,7 +1132,7 @@
 
     void ArtificialController::setPreviousMode()
     {
-        this->mode_ = DEFAULT;
+        this->mode_ = DEFAULT; //Vector-implementation: mode_.pop_back();
     }
     
 }

Modified: code/branches/ai/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/ai/src/orxonox/controllers/ArtificialController.h	2011-06-30 15:20:39 UTC (rev 8719)
+++ code/branches/ai/src/orxonox/controllers/ArtificialController.h	2011-06-30 18:30:13 UTC (rev 8720)
@@ -145,14 +145,14 @@
             WeakPtr<Pawn> target_;
             bool bShooting_;
 	    
-            int numberOfWeapons;//< Used for weapon init function. Displayes number of weapons available for a bot.
+            int numberOfWeapons; //< Used for weapon init function. Displayes number of weapons available for a bot.
             int weapons[WeaponSystem::MAX_WEAPON_MODES];
 	    int projectiles[WeaponSystem::MAX_WEAPON_MODES];
 	    float botlevel_; //< Makes the level of a bot configurable.
             float timeout_; //< Timeout for rocket usage. (If a rocket misses, a bot should stop using it.)
 
             enum Mode {DEFAULT, ROCKET, DEFENCE, MOVING};//TODO; implement DEFENCE, MOVING modes
-            Mode mode_;
+            Mode mode_; //TODO: replace single value with stack-like implementation: std::vector<Mode> mode_;
             void setPreviousMode();
 
         private:




More information about the Orxonox-commit mailing list