Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10850


Ignore:
Timestamp:
Nov 24, 2015, 5:52:43 PM (9 years ago)
Author:
gania
Message:

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.

Location:
code/branches/campaignHS15/src/orxonox/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/campaignHS15/src/orxonox/controllers/CommonController.cc

    r10849 r10850  
    7676        SUPER( CommonController, XMLPort, xmlelement, mode );
    7777        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 );
    8178        XMLPortObject(CommonController, WorldEntity, "actionpoints", addActionpoint, getActionpoint,  xmlelement, mode);
    8279
    8380    }
    84     void CommonController::setProtectXML( std::string val )
    85     {
    86         this->protectName_ = val;
    87        
    88     }
     81   
    8982    void CommonController::tick(float dt)
    9083    {
     
    131124        return this->protect_;
    132125    }
    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 
    154127    std::string CommonController::getActionXML()
    155128    {
  • code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc

    r10849 r10850  
    7474    void DivisionController::action()
    7575    {
    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         }*/
    9176        //----Whatever ship is doing, if there are targets close to it and its own target is far away, fight them----
    9277        //analog to attack move
Note: See TracChangeset for help on using the changeset viewer.