- Timestamp:
- May 31, 2010, 5:31:50 AM (15 years ago)
- Location:
- code/branches/presentation3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3
- Property svn:mergeinfo changed
/code/branches/ai (added) merged: 6592,6601,6640,6683,6695-6696,6782,6795,6832-6833,6847,6850,6854,6888,6891,6918-6919,6958,6978,6986,6991,6997,7029,7033
- Property svn:mergeinfo changed
-
code/branches/presentation3/src/orxonox/controllers/ArtificialController.h
r6417 r7034 23 23 * Fabian 'x3n' Landau 24 24 * Co-authors: 25 * ...25 * Dominik Solenicki 26 26 * 27 27 */ … … 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include <vector> 35 34 36 #include "util/Math.h" 35 37 #include "Controller.h" 38 #include "controllers/NewHumanController.h" 36 39 37 40 namespace orxonox … … 43 46 virtual ~ArtificialController(); 44 47 48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 49 45 50 void abandonTarget(Pawn* target); 46 51 52 inline void setTeam(int team) 53 { this->team_ = team; } 54 inline int getTeam() const 55 { return this->team_; } 56 inline void setFormationFlight(bool formation) 57 { this->formationFlight_ = formation; } 58 inline bool getFormationFlight() const 59 { return this->formationFlight_; } 60 inline void setFormationSize(int size) 61 { this->maxFormationSize_ = size; } 62 inline int getFormationSize() const 63 { return this->maxFormationSize_; } 64 virtual void changedControllableEntity(); 65 66 static void formationflight(bool form); 67 static void masteraction(int action); 68 static void followme(); 69 static void passivebehaviour(bool passive); 70 static void formationsize(int size); 71 47 72 protected: 73 74 int team_; 75 bool formationFlight_; 76 bool passive_; 77 unsigned int maxFormationSize_; 78 int freedomCount_; 79 enum State {SLAVE, MASTER, FREE}; 80 State state_; 81 std::vector<ArtificialController*> slaves_; 82 ArtificialController *myMaster_; 83 enum SpecificMasterAction {NONE, HOLD, SPIN, TURN180, FOLLOWHUMAN}; 84 SpecificMasterAction specificMasterAction_; 85 int specificMasterActionHoldCount_; 86 Pawn* humanToFollow_; 87 48 88 void targetDied(); 49 89 50 90 void moveToPosition(const Vector3& target); 51 91 void moveToTargetPosition(); 92 93 int getState(); 94 95 void unregisterSlave(); 96 void searchNewMaster(); 97 void commandSlaves(); 98 void setNewMasterWithinFormation(); 99 100 void freeSlaves(); 101 void forceFreeSlaves(); 102 void loseMasterState(); 103 void forceFreedom(); 104 bool forcedFree(); 105 106 void specificMasterActionHold(); 107 void turn180Init(); 108 void turn180(); 109 void spinInit(); 110 void spin(); 111 void followHumanInit(Pawn* human, bool always); 112 void follow(); 52 113 53 114 void setTargetPosition(const Vector3& target);
Note: See TracChangeset
for help on using the changeset viewer.