Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 27, 2015, 4:42:14 PM (8 years ago)
Author:
gania
Message:

CommonController now has static methods only. Replace with a namespace?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc

    r10875 r10877  
    3131#include "core/XMLPort.h"
    3232#include <algorithm>
     33#include "worldentities/Actionpoint.h"
    3334
    3435
     
    3839    RegisterClass(ActionpointController);
    3940
    40     //CommonController contains all common functionality of AI Controllers
    4141    ActionpointController::ActionpointController(Context* context) : FightingController(context)
    4242    {
    43               this->bInLoop_ = false;
     43        this->bInLoop_ = false;
    4444        this->bLoop_ = false;
    4545        this->bEndLoop_ = false;
     
    4848        this->action_ = Action::NONE;
    4949        this->squaredaccuracy_ = 2500;
    50 
     50        this->bFirstTick_ = true;
    5151
    5252        RegisterObject(ActionpointController);
     
    559559        if (this->action_ != Action::FIGHT && this->action_ != Action::FIGHTALL)
    560560        {
    561             if ( (this->target_ && this->distance (this->getControllableEntity(), this->target_) > this->attackRange_)
     561            if ( (this->target_ && CommonController::distance (this->getControllableEntity(), this->target_) > this->attackRange_)
    562562                || !this->target_ )
    563563            {
    564564                Pawn* newTarget = this->closestTarget();
    565565                if ( newTarget &&
    566                     this->distance (this->getControllableEntity(), static_cast<ControllableEntity*>(newTarget))
     566                    CommonController::distance (this->getControllableEntity(), static_cast<ControllableEntity*>(newTarget))
    567567                        <= this->attackRange_ )
    568568                {
    569                     Point p = { Action::FIGHT, this->getName(newTarget), Vector3::ZERO, false };
     569                    Point p = { Action::FIGHT, CommonController::getName(newTarget), Vector3::ZERO, false };
    570570                    this->parsedActionpoints_.push_back(p);
    571571                    this->executeActionpoint();
Note: See TracChangeset for help on using the changeset viewer.