Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 11, 2015, 3:16:48 PM (8 years ago)
Author:
gania
Message:

a little clean up

File:
1 edited

Legend:

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

    r10958 r10968  
    3838    {
    3939        RegisterObject(MasterController);
    40         // orxout(internal_error) << "MasterController was created" << endl;
    41 
    4240        this->controllers_.clear();
    4341        this->numberOfTicksPassedSinceLastActionCall_ = 0;
     
    5048        this->controllers_.clear();
    5149    }
     50    /*HACK*/
     51    //the whole idea is a hack
    5252    void MasterController::tick(float dt)
    5353    {   
     
    5555            return; 
    5656        ++this->ticks_;
    57         //orxout(internal_error) << "Tick = " << this->ticks_ << endl;
    5857        if (this->ticks_ == 1)
    5958        {
     
    6665                this->controllers_.push_back(*it);
    6766            }
    68             //orxout(internal_error) << "I got " << this->controllers_.size() << " controllers" << endl;
    6967        }
    7068        else
    7169        {
    72 
    7370            if (this->controllers_.empty())
    7471                return;
     
    8784            if (this->numberOfTicksPassedSinceLastActionCall_ > 0)
    8885            {
    89                 //call maneuver for current index
    9086                if (this->numberOfTicksPassedSinceLastActionCall_ == 3)
    9187                {
     88                    //check if 0ptr
    9289                    if (!this->controllers_.at(this->indexOfCurrentController_))
    9390                    {
     
    9592                        return;
    9693                    }
    97                     //orxout (internal_error) << "Executing maneuver of Controller # " << this->indexOfCurrentController_ << endl;
     94                    //call maneuver for current index
    9895                    this->controllers_.at(this->indexOfCurrentController_)->maneuver();
    9996                }
    10097                else if (this->numberOfTicksPassedSinceLastActionCall_ == 6)
    10198                {
    102                     //call canFire for current index
     99                    //check if 0ptr
    103100                    if (!this->controllers_.at(this->indexOfCurrentController_))
    104101                    {
     
    106103                        return;
    107104                    }
    108                     //orxout (internal_error) << "Executing maneuver of Controller # " << this->indexOfCurrentController_ << endl;
     105                    //call canFire for current index
    109106                    this->controllers_.at(this->indexOfCurrentController_)->bShooting_ = this->controllers_.at(this->indexOfCurrentController_)->canFire();   
    110107                }
     
    113110            else
    114111            {
    115                 //call action for current index
     112                //check if 0ptr
    116113                if (!this->controllers_.at(this->indexOfCurrentController_))
    117114                {
     
    119116                    return;
    120117                }
    121                 //orxout (internal_error) << "Executing action of Controller # " << this->indexOfCurrentController_ << endl;
    122                 this->controllers_.at(this->indexOfCurrentController_)->action();   
     118                //call action for current index
     119                this->controllers_.at(this->indexOfCurrentController_)->action();   
     120                 
    123121                //bCopyOrientation makes ship oscillate like crazy if set to true all the time.s
    124122                this->controllers_.at(this->indexOfCurrentController_)->bCopyOrientation_ = this->ticks_ % 3 == 0;
Note: See TracChangeset for help on using the changeset viewer.