Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 26, 2015, 5:44:31 PM (9 years ago)
Author:
gania
Message:

Restructured

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc

    r10682 r10709  
    3232namespace orxonox
    3333{
    34     const float WingmanController::ACTION_INTERVAL = 1.0f;
    3534
    3635    RegisterClass(WingmanController);
    3736
    38     WingmanController::WingmanController(Context* context) : SectionController(context)
     37    WingmanController::WingmanController(Context* context) : Controller(context)
    3938    {
    4039        RegisterObject(WingmanController);
    41         this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&WingmanController::action, this)));
     40        //this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&WingmanController::action, this)));
    4241    }
    4342
     
    5554    void WingmanController::action()
    5655    {
    57         //--------------------------Cover Leader's rear--------------------------
    58         //check for enemies in Leader's rear that can attack him and if they are visible, meaning there are no other Leader's between Leader and enemies.
    59         //if there are enemies, set target_ to the nearest one and set bFollowLeader_ to false,
    60         //otherwise set bFollowLeader_ to true and target_ to sectionTarget_
    61         this->coverAllyRear(this->sectionLeader_);
     56        //this->target_ = this->sectionTarget_;
    6257    }
    6358
    6459    void WingmanController::tick(float dt)
    65     {
     60    {/*
    6661        if (!this->isActive())
    6762            return;
     
    6964        if (bFollowLeader_)
    7065        {
    71             this->keepSectionTick();
     66            this->keepSectionTick();*/
    7267            /*keepSectionTick(){
    7368                if (this->sectionLeader_ && this->sectionLeader_->getControllableEntity() && desiredRelativePosition_){
     
    7873            }
    7974            */
    80            
     75          /* 
    8176            //--------------------------Attack same target as the Leader--------------------------
    82            
     77
    8378            if (this->target_)
    8479            {
     
    8681                this->doFire();
    8782            }
    88         }
    89         //--------------------------Protect Leader by killing target_--------------------------
    90 
    91         else
    92         {
    93             if (this->target_)
    94             {
    95                 //--------------------------Don't attack if not visible--------------------------               
    96                 if (!this->target_->getRadarVisibility()) /* So AI won't shoot invisible Spaceships */
    97                 {
    98                     this->forgetTarget();
    99                     //this->bFollowLeader_ = true;
    100                 }
    101                 //--------------------------Otherwise destroy it--------------------------
    102                 else
    103                 {
    104                     this->aimAtTarget();
    105                     this->follow();  //If a bot is shooting a player, it shouldn't let him go away easily.
    106                 }
    107                 if (this->bHasTargetPosition_)
    108                 {
    109                     this->moveToTargetPosition();
    110                 }
    111                 this->doFire();
    112             }
    113             //--------------------------no target? do nothing until next action() -> either new target appears or bFollowLeader_ set to true--------------------------
    114             else
    115             {
    116 
    117             }           
    118 
    119         }
     83        }*/
     84         //orxout(internal_error) << "I am " << this << endl;
     85       
    12086        SUPER(WingmanController, tick, dt);
    12187    }
Note: See TracChangeset for help on using the changeset viewer.