[Orxonox-commit 6192] r10850 - code/branches/campaignHS15/src/orxonox/controllers

gania at orxonox.net gania at orxonox.net
Tue Nov 24 17:52:43 CET 2015


Author: gania
Date: 2015-11-24 17:52:43 +0100 (Tue, 24 Nov 2015)
New Revision: 10850

Modified:
   code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc
   code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc
Log:
ok, now you can use attack and protect just like in my level, but I only updated DivsionController, will finish others some time soon. Anyways, Actionpoints are to be inserted in DivisionController only.

Modified: code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc	2015-11-24 16:21:03 UTC (rev 10849)
+++ code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc	2015-11-24 16:52:43 UTC (rev 10850)
@@ -75,17 +75,10 @@
     {
         SUPER( CommonController, XMLPort, xmlelement, mode );
         XMLPortParam( CommonController, "formationMode", setFormationModeXML, getFormationModeXML,  xmlelement, mode );
-        //XMLPortParam( CommonController, "action", setActionXML, getActionXML,  xmlelement, mode );
-        //XMLPortParam ( CommonController, "protect", setProtectXML, getProtectXML,  xmlelement, mode );
-        //XMLPortParam ( CommonController, "enemy", setEnemyXML, getEnemyXML,  xmlelement, mode );
         XMLPortObject(CommonController, WorldEntity, "actionpoints", addActionpoint, getActionpoint,  xmlelement, mode);
 
     }
-    void CommonController::setProtectXML( std::string val )
-    {
-        this->protectName_ = val;
-        
-    }
+   
     void CommonController::tick(float dt)
     {
         if (this->bHasTargetPosition_)
@@ -130,27 +123,7 @@
     {
         return this->protect_;
     }
-    void CommonController::setActionXML( std::string val)
-    {
-        const std::string valUpper = getUppercase( val );
-        Action::Value value;
-        
-        if ( valUpper == "FIGHT" )
-            value = Action::FIGHT;
-        else if ( valUpper == "FLY" )
-            value = Action::FLY;
-        else if ( valUpper == "PROTECT" )
-            value = Action::PROTECT;
-        else if ( valUpper == "NONE" )
-            value = Action::NONE;
-        else if ( valUpper == "FIGHTALL" )
-            value = Action::FIGHTALL;
-        else if ( valUpper == "ATTACK" )
-            value = Action::ATTACK;
-        else
-            ThrowException( ParseError, std::string( "Attempting to set an unknown Action: '" )+ val + "'." );
-        this->setAction( value );
-    }
+  
     std::string CommonController::getActionXML()
     {
         switch ( this->action_ )

Modified: code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc
===================================================================
--- code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc	2015-11-24 16:21:03 UTC (rev 10849)
+++ code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc	2015-11-24 16:52:43 UTC (rev 10850)
@@ -73,21 +73,6 @@
     }
     void DivisionController::action()
     {
-
-        
-  /*      if (this->target_)
-        {
-            if (CommonController::distance (this->getControllableEntity(), newTarget) < 
-                CommonController::distance (this->getControllableEntity(), target_))
-            {
-                Actionpoint* ap = new Actionpoint(this->getContext());
-                ap->setPosition (0, 0, 0);
-                ap->setActionXML ("FIGHT");
-                //ap->setEnemyXML(CommonController::getName(newTarget));
-                this->addActionpoint (ap);
-            }
-
-        }*/
         //----Whatever ship is doing, if there are targets close to it and its own target is far away, fight them----
         //analog to attack move
         if (this->action_ != Action::FIGHT && this->action_ != Action::FIGHTALL)




More information about the Orxonox-commit mailing list