Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8720 for code


Ignore:
Timestamp:
Jun 30, 2011, 8:30:13 PM (13 years ago)
Author:
jo
Message:

Just a backup, before starting to update the ai branch.

Location:
code/branches/ai/src/orxonox/controllers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai/src/orxonox/controllers/AIController.cc

    r8711 r8720  
    208208        if (!this->isActive())
    209209            return;
    210 
     210        //Vector-implementation: if(target_.size() == 0) target[0] = DEFAULT;
    211211        if(this->mode_ == DEFAULT)
    212         {
     212        {//Vector-implementation: mode_.back() == DEFAULT;
    213213            if (this->state_ == MASTER)
    214214            {
     
    271271        }//END_OF DEFAULT MODE
    272272        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;
    274274            ControllableEntity *controllable = this->getControllableEntity();
    275275            if(controllable)
  • code/branches/ai/src/orxonox/controllers/ArtificialController.cc

    r8719 r8720  
    9191        this->numberOfWeapons = 0;
    9292        this->botlevel_ = 1.0f;
    93         this->mode_ = DEFAULT;
     93        this->mode_ = DEFAULT;////Vector-implementation: mode_.push_back(DEFAULT);
    9494        this->timeout_=0;
    9595    }
     
    9898    {
    9999        if (this->isInitialized())
    100         {
     100        {//Vector-implementation: mode_.erase(mode_.begin(),mode_.end());
    101101            this->removeFromFormation();
    102102
     
    10461046            {//ROCKET: mid range weapon
    10471047                //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);
    10491049                this->getControllableEntity()->fire(3);//launch rocket
    10501050                if(this->getControllableEntity()&&this->target_)//after fire(3) getControllableEntity() refers to the rocket!
     
    10811081                    else if(wpn=="LaserMunition")//other munitiontypes are not defined yet :-(
    10821082                        weapons[0]=0;
    1083                     else if(wpn=="LENSFLARE")//TODO: insert right munition name
     1083                    else if(wpn=="FusionMunition")
    10841084                        weapons[1]=1;
    1085                     else if(wpn=="SIMPLEROCKET")//TODO: insert right munition name
     1085                    else if(wpn=="TargetSeeking Rockets")
    10861086                        weapons[2]=2;
    10871087                    else if(wpn=="ROCKET")//TODO: insert right munition name
     
    11331133    void ArtificialController::setPreviousMode()
    11341134    {
    1135         this->mode_ = DEFAULT;
     1135        this->mode_ = DEFAULT; //Vector-implementation: mode_.pop_back();
    11361136    }
    11371137   
  • code/branches/ai/src/orxonox/controllers/ArtificialController.h

    r8719 r8720  
    146146            bool bShooting_;
    147147           
    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.
    149149            int weapons[WeaponSystem::MAX_WEAPON_MODES];
    150150            int projectiles[WeaponSystem::MAX_WEAPON_MODES];
     
    153153
    154154            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_;
    156156            void setPreviousMode();
    157157
Note: See TracChangeset for help on using the changeset viewer.