- Timestamp:
- Oct 12, 2011, 7:50:43 PM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/orxonox/controllers/ArtificialController.h
r8706 r8891 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include < vector>34 #include <map> 35 35 36 36 #include "util/Math.h" 37 37 #include "Controller.h" 38 38 #include "controllers/NewHumanController.h" 39 #include "weaponsystem/WeaponSystem.h" 39 40 40 41 namespace orxonox … … 78 79 static void formationsize(const int size); 79 80 81 virtual void doFire(); 82 void setBotLevel(float level=1.0f); 83 inline float getBotLevel() const 84 { return this->botlevel_; } 85 static void setAllBotLevel(float level); 86 //WAYPOINT FUNCTIONS 87 void addWaypoint(WorldEntity* waypoint); 88 WorldEntity* getWaypoint(unsigned int index) const; 89 90 inline void setAccuracy(float accuracy) 91 { this->squaredaccuracy_ = accuracy*accuracy; } 92 inline float getAccuracy() const 93 { return sqrt(this->squaredaccuracy_); } 94 void updatePointsOfInterest(std::string name, float distance); 95 void manageWaypoints(); 96 80 97 protected: 81 98 … … 96 113 void moveToPosition(const Vector3& target); 97 114 void moveToTargetPosition(); 115 void absoluteMoveToPosition(const Vector3& target); 98 116 99 117 virtual void positionReached() {} … … 135 153 136 154 static bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype); // hack 155 void boostControl(); //<! Sets and resets the boost parameter of the spaceship. Bots alternate between boosting and saving boost. 137 156 138 157 bool bHasTargetPosition_; … … 141 160 bool bShooting_; 142 161 143 private: 162 float botlevel_; //<! Makes the level of a bot configurable. 163 enum Mode {DEFAULT, ROCKET, DEFENCE, MOVING};//TODO; implement DEFENCE, MOVING modes 164 Mode mode_; //TODO: replace single value with stack-like implementation: std::vector<Mode> mode_; 165 void setPreviousMode(); 166 167 //WEAPONSYSTEM DATA 168 std::map<std::string, int> weaponModes_; //<! Links each "weapon" to it's weaponmode- managed by setupWeapons() 169 //std::vector<int> projectiles_; //<! Displays amount of projectiles of each weapon. - managed by setupWeapons() 170 float timeout_; //<! Timeout for rocket usage. (If a rocket misses, a bot should stop using it.) 171 void setupWeapons(); //<! Defines which weapons are available for a bot. Is recalled whenever a bot was killed. 172 bool bSetupWorked; //<! If false, setupWeapons() is called. 173 int getFiremode(std::string name); 174 175 //WAYPOINT DATA 176 std::vector<WeakPtr<WorldEntity> > waypoints_; 177 size_t currentWaypoint_; 178 float squaredaccuracy_; 179 WorldEntity* defaultWaypoint_; 144 180 }; 145 181 }
Note: See TracChangeset
for help on using the changeset viewer.