- Timestamp:
- Dec 11, 2015, 3:16:48 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/MasterController.cc
r10958 r10968 38 38 { 39 39 RegisterObject(MasterController); 40 // orxout(internal_error) << "MasterController was created" << endl;41 42 40 this->controllers_.clear(); 43 41 this->numberOfTicksPassedSinceLastActionCall_ = 0; … … 50 48 this->controllers_.clear(); 51 49 } 50 /*HACK*/ 51 //the whole idea is a hack 52 52 void MasterController::tick(float dt) 53 53 { … … 55 55 return; 56 56 ++this->ticks_; 57 //orxout(internal_error) << "Tick = " << this->ticks_ << endl;58 57 if (this->ticks_ == 1) 59 58 { … … 66 65 this->controllers_.push_back(*it); 67 66 } 68 //orxout(internal_error) << "I got " << this->controllers_.size() << " controllers" << endl;69 67 } 70 68 else 71 69 { 72 73 70 if (this->controllers_.empty()) 74 71 return; … … 87 84 if (this->numberOfTicksPassedSinceLastActionCall_ > 0) 88 85 { 89 //call maneuver for current index90 86 if (this->numberOfTicksPassedSinceLastActionCall_ == 3) 91 87 { 88 //check if 0ptr 92 89 if (!this->controllers_.at(this->indexOfCurrentController_)) 93 90 { … … 95 92 return; 96 93 } 97 // orxout (internal_error) << "Executing maneuver of Controller # " << this->indexOfCurrentController_ << endl;94 //call maneuver for current index 98 95 this->controllers_.at(this->indexOfCurrentController_)->maneuver(); 99 96 } 100 97 else if (this->numberOfTicksPassedSinceLastActionCall_ == 6) 101 98 { 102 //c all canFire for current index99 //check if 0ptr 103 100 if (!this->controllers_.at(this->indexOfCurrentController_)) 104 101 { … … 106 103 return; 107 104 } 108 // orxout (internal_error) << "Executing maneuver of Controller # " << this->indexOfCurrentController_ << endl;105 //call canFire for current index 109 106 this->controllers_.at(this->indexOfCurrentController_)->bShooting_ = this->controllers_.at(this->indexOfCurrentController_)->canFire(); 110 107 } … … 113 110 else 114 111 { 115 //c all action for current index112 //check if 0ptr 116 113 if (!this->controllers_.at(this->indexOfCurrentController_)) 117 114 { … … 119 116 return; 120 117 } 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 123 121 //bCopyOrientation makes ship oscillate like crazy if set to true all the time.s 124 122 this->controllers_.at(this->indexOfCurrentController_)->bCopyOrientation_ = this->ticks_ % 3 == 0;
Note: See TracChangeset
for help on using the changeset viewer.