- Timestamp:
- Nov 26, 2015, 9:08:11 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/CommonController.h
r10861 r10864 61 61 62 62 } 63 namespace Action 64 { 65 enum Value 66 { 67 NONE, FLY, FIGHT, PROTECT, FIGHTALL, ATTACK 68 }; 69 70 } 71 72 struct Point { 73 Action::Value action; 74 std::string name; 75 Vector3 position; 76 bool inLoop; 77 } ; 78 63 79 64 80 65 … … 96 81 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 97 82 98 99 100 101 83 void setFormationModeXML(std::string val); 84 std::string getFormationModeXML(); 85 void setFormationMode(FormationMode::Value val); 86 FormationMode::Value getFormationMode() const; 102 87 103 void setRank(Rank::Value val); 104 Rank::Value getRank() const; 105 106 void addActionpoint(WorldEntity* waypoint); 107 WorldEntity* getActionpoint(unsigned int index) const; 88 void setRank(Rank::Value val); 89 Rank::Value getRank() const; 90 91 108 92 //----[/XML methods]---- 109 93 … … 115 99 ControllableEntity* getTarget(); 116 100 117 Action::Value getAction (); 118 std::string getActionName(); 119 120 void setAction (Action::Value action); 121 void setAction (Action::Value action, ControllableEntity* target); 122 void setAction (Action::Value action, const Vector3& target); 123 void setAction (Action::Value action, const Vector3& target, const Quaternion& orient ); 124 //----[/Interaction with other Controllers]---- 101 //----[/Interaction with other Controllers]---- 125 102 126 103 //----[Helper methods]---- … … 135 112 //----[/Helper methods]---- 136 113 137 138 virtual void stayNearProtect(); 139 virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour. 140 virtual void takeActionpoints (std::vector<Point > vector, std::vector<Point > loop, bool b); 141 114 142 115 protected: 143 116 //----[Flying methods]---- … … 168 141 void setOrientationOfTarget(const Quaternion& orient); 169 142 170 void setProtect (ControllableEntity* protect);171 ControllableEntity* getProtect ();172 143 173 144 void maneuver(); … … 175 146 bool canFire(); 176 147 void doFire(); 177 void setClosestTarget(); 178 Pawn* closestTarget(); 179 void startAttackingEnemiesThatAreClose(); 148 180 149 //----[/Fighting methods]---- 181 150 … … 200 169 //----[/who-to-kill information]---- 201 170 202 //----[Actionpoint information]----203 171 204 std::vector<WeakPtr<WorldEntity> > actionpoints_;205 float squaredaccuracy_;206 std::vector<Point > parsedActionpoints_;207 std::vector<Point > loopActionpoints_;208 209 //----[/Actionpoint information]----210 //----[Actionpoint methods]----211 void executeActionpoint();212 void nextActionpoint();213 void fillLoop();214 void fillLoopReversed();215 void moveBackToTop();216 //----[Actionpoint methods]----217 172 //----["Private" variables]---- 218 173 FormationMode::Value formationMode_; 219 174 Rank::Value rank_; 220 std::string protectName_; 221 std::string targetName_; 222 Action::Value action_; 175 223 176 int attackRange_; 224 177 bool bLookAtTarget_; … … 227 180 int tolerance_; 228 181 bool bFirstTick_; 229 bool bInLoop_; 230 bool bLoop_; 231 bool bEndLoop_; 232 bool bTakenOver_; 182 233 183 //----[/"Private" variables]---- 234 184
Note: See TracChangeset
for help on using the changeset viewer.