- Timestamp:
- Oct 26, 2015, 5:44:31 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/AI_HS15/src/orxonox/controllers/LeaderController.cc
r10682 r10709 33 33 namespace orxonox 34 34 { 35 const float LeaderController::ACTION_INTERVAL = 1.0f;36 35 37 36 RegisterClass(LeaderController); 38 37 39 LeaderController::LeaderController(Context* context) : SectionController(context)38 LeaderController::LeaderController(Context* context) : WingmanController(context) 40 39 { 40 41 41 RegisterObject(LeaderController); 42 this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&LeaderController::action, this)));42 //this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&LeaderController::action, this))); 43 43 } 44 44 45 45 46 LeaderController::~LeaderController() … … 49 50 void LeaderController::action() 50 51 { 51 52 //this->target_ = this->sectionTarget_; 52 53 } 53 54 /* … … 66 67 */ 67 68 void LeaderController::tick(float dt) 68 { 69 {/* 69 70 if (!this->isActive()) 70 71 return; 71 72 72 73 //--------------------------Stay in division-------------------------- 73 this->keepDivisionTick(); 74 this->keepDivisionTick();*/ 74 75 /*keepDivisionTick(){ 75 76 if (this->divisionLeader_ && this->divisionLeader_->getControllableEntity() && desiredRelativePosition_){ … … 80 81 } 81 82 */ 82 / /If ordered to attack -> follow target and shoot83 /*//If ordered to attack -> follow target and shoot 83 84 if (this->bAttackOrder_) 84 85 { 85 86 86 87 } 87 88 //If ordered to move -> move to a target Point 88 else if (this->bMoveOrder_) 89 { 90 91 } 92 else 89 93 90 //No orders -> Don't move, but shoot at whatever is close, unless Boss is shooting at it. 94 91 //(Section shoots same target, Boss's section shoots another target) 95 92 { 96 93 97 } 94 }*/ 98 95 99 96 orxout(internal_error) << "my Wingman is " << this->wingman_ << endl; 97 100 98 SUPER(LeaderController, tick, dt); 99 } 100 void LeaderController::setWingman(WingmanController* wingman) 101 { 102 this->wingman_ = wingman; 101 103 } 102 104 //**********************************************NEW
Note: See TracChangeset
for help on using the changeset viewer.