Changeset 10850
- Timestamp:
- Nov 24, 2015, 5:52:43 PM (9 years ago)
- Location:
- code/branches/campaignHS15/src/orxonox/controllers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc
r10849 r10850 76 76 SUPER( CommonController, XMLPort, xmlelement, mode ); 77 77 XMLPortParam( CommonController, "formationMode", setFormationModeXML, getFormationModeXML, xmlelement, mode ); 78 //XMLPortParam( CommonController, "action", setActionXML, getActionXML, xmlelement, mode );79 //XMLPortParam ( CommonController, "protect", setProtectXML, getProtectXML, xmlelement, mode );80 //XMLPortParam ( CommonController, "enemy", setEnemyXML, getEnemyXML, xmlelement, mode );81 78 XMLPortObject(CommonController, WorldEntity, "actionpoints", addActionpoint, getActionpoint, xmlelement, mode); 82 79 83 80 } 84 void CommonController::setProtectXML( std::string val ) 85 { 86 this->protectName_ = val; 87 88 } 81 89 82 void CommonController::tick(float dt) 90 83 { … … 131 124 return this->protect_; 132 125 } 133 void CommonController::setActionXML( std::string val) 134 { 135 const std::string valUpper = getUppercase( val ); 136 Action::Value value; 137 138 if ( valUpper == "FIGHT" ) 139 value = Action::FIGHT; 140 else if ( valUpper == "FLY" ) 141 value = Action::FLY; 142 else if ( valUpper == "PROTECT" ) 143 value = Action::PROTECT; 144 else if ( valUpper == "NONE" ) 145 value = Action::NONE; 146 else if ( valUpper == "FIGHTALL" ) 147 value = Action::FIGHTALL; 148 else if ( valUpper == "ATTACK" ) 149 value = Action::ATTACK; 150 else 151 ThrowException( ParseError, std::string( "Attempting to set an unknown Action: '" )+ val + "'." ); 152 this->setAction( value ); 153 } 126 154 127 std::string CommonController::getActionXML() 155 128 { -
code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc
r10849 r10850 74 74 void DivisionController::action() 75 75 { 76 77 78 /* if (this->target_)79 {80 if (CommonController::distance (this->getControllableEntity(), newTarget) <81 CommonController::distance (this->getControllableEntity(), target_))82 {83 Actionpoint* ap = new Actionpoint(this->getContext());84 ap->setPosition (0, 0, 0);85 ap->setActionXML ("FIGHT");86 //ap->setEnemyXML(CommonController::getName(newTarget));87 this->addActionpoint (ap);88 }89 90 }*/91 76 //----Whatever ship is doing, if there are targets close to it and its own target is far away, fight them---- 92 77 //analog to attack move
Note: See TracChangeset
for help on using the changeset viewer.