Changeset 9797
- Timestamp:
- Nov 21, 2013, 3:57:23 PM (11 years ago)
- Location:
- code/trunk/src/orxonox/controllers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/controllers/Controller.cc
r9667 r9797 29 29 #include "Controller.h" 30 30 #include "core/CoreIncludes.h" 31 #include "core/XMLPort.h" 31 32 #include "worldentities/ControllableEntity.h" 32 33 … … 42 43 this->controllableEntity_ = 0; 43 44 this->bGodMode_ = false; 45 this->team_=-1; 44 46 } 45 47 … … 47 49 { 48 50 } 51 void Controller::XMLPort(Element& xmlelement, XMLPort::Mode mode) 52 { 53 SUPER(Controller, XMLPort, xmlelement, mode); 54 XMLPortParam(Controller, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1); 55 } 56 49 57 } -
code/trunk/src/orxonox/controllers/Controller.h
r9667 r9797 32 32 #include "OrxonoxPrereqs.h" 33 33 #include "core/BaseObject.h" 34 #include "core/class/Super.h" 34 35 35 36 namespace orxonox … … 44 45 Controller(Context* context); 45 46 virtual ~Controller(); 46 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 47 48 inline void setPlayer(PlayerInfo* player) 48 49 { this->player_ = player; } 49 50 inline PlayerInfo* getPlayer() const 50 51 { return this->player_; } 52 inline void setTeam(int team) 53 { this->team_ = team; } 54 inline int getTeam() const 55 { return this->team_; } 51 56 52 57 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) {}; … … 79 84 PlayerInfo* player_; 80 85 ControllableEntity* controllableEntity_; 86 int team_; 81 87 private: 82 88 bool bGodMode_; -
code/trunk/src/orxonox/controllers/FormationController.cc
r9667 r9797 88 88 this->speedCounter_ = 0.2f; 89 89 this->targetPosition_ = Vector3::ZERO; 90 this->team_=-1;91 90 this->target_.setCallback(createFunctor(&FormationController::targetDied, this)); 92 91 } … … 128 127 SUPER(FormationController, XMLPort, xmlelement, mode); 129 128 130 XMLPortParam(FormationController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1);131 129 XMLPortParam(FormationController, "formationFlight", setFormationFlight, getFormationFlight, xmlelement, mode).defaultValues(false); 132 130 XMLPortParam(FormationController, "formationSize", setFormationSize, getFormationSize, xmlelement, mode).defaultValues(STANDARD_MAX_FORMATION_SIZE); -
code/trunk/src/orxonox/controllers/FormationController.h
r9667 r9797 76 76 { return this->passive_; } 77 77 78 inline void setTeam(int team) 79 { this->team_ = team; } 80 inline int getTeam() const 81 { return this->team_; } 78 82 79 83 80 /** … … 105 102 bool formationFlight_; 106 103 bool passive_; 107 int team_;108 104 unsigned int maxFormationSize_; 109 105 int freedomCount_;
Note: See TracChangeset
for help on using the changeset viewer.