- Timestamp:
- Oct 31, 2015, 4:07:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/AI_HS15/src/orxonox/controllers/SectionController.h
r10729 r10731 40 40 { 41 41 public: 42 42 43 SectionController(Context* context); 43 44 virtual ~SectionController(); 44 virtual bool setWingman(CommonController* cwingman)45 {46 WeakPtr<WingmanController> wingman = orxonox_cast<WingmanController*>(cwingman);45 46 virtual void tick(float dt); //<! Carrying out the targets set in action(). 47 47 48 48 if (!this->myWingman_) 49 { 50 this->myWingman_ = wingman; 51 return true; 52 } 53 else 54 { 55 return false; 56 } 57 } 58 59 60 virtual bool hasWingman() 61 { 62 if (this->myWingman_) 63 return true; 64 else 65 return false; 66 } 67 68 virtual void tick(float dt); //<! Carrying out the targets set in action(). 69 49 LeaderController* findNewDivisionLeader(); 50 virtual bool setWingman(CommonController* cwingman); 51 virtual bool hasWingman(); 52 70 53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 71 LeaderController* findNewDivisionLeader();72 54 73 55 protected: 56 74 57 void setTargetPositionOfWingman(); 75 //A division is the biggest block of spaceships. 76 //In division one section is leading, the other one always stays on the same position 77 //relative to the Leader of the leading section. 78 //In section a Wingman always stays on same position relative to the Leader. 79 //That position is desiredRelativePosition_ 58 80 59 virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets. 81 60 61 private: 82 62 83 84 85 86 private:87 63 Timer actionTimer_; //<! Regularly calls action(). 88 64
Note: See TracChangeset
for help on using the changeset viewer.