Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9252


Ignore:
Timestamp:
May 28, 2012, 12:00:53 AM (12 years ago)
Author:
landauf
Message:

added missing call to RegisterObject (it crashed on windows)
moved XMLPort from WaypointController to ArtificialController

Location:
code/trunk/src/orxonox/controllers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/controllers/ArtificialController.cc

    r9016 r9252  
    2424 *   Co-authors:
    2525 *      Dominik Solenicki
    26  *     
     26 *
    2727 */
    2828
    2929#include "ArtificialController.h"
    3030#include "core/CoreIncludes.h"
     31#include "core/XMLPort.h"
    3132#include "core/command/ConsoleCommand.h"
    3233#include "worldentities/pawns/Pawn.h"
     
    4647    ArtificialController::ArtificialController(BaseObject* creator) : FormationController(creator)
    4748    {
     49        RegisterObject(ArtificialController);
     50
    4851        this->bSetupWorked = false;
    4952        this->botlevel_ = 0.5f;
     
    6467    }
    6568
     69    void ArtificialController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     70    {
     71        SUPER(ArtificialController, XMLPort, xmlelement, mode);
     72
     73        XMLPortParam(ArtificialController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
     74        XMLPortObject(ArtificialController, WorldEntity, "waypoints", addWaypoint, getWaypoint,  xmlelement, mode);
     75    }
    6676
    6777    /**
     
    276286            this->updatePointsOfInterest("PickupSpawner", 20.0f); // take pickup en passant if there is a default waypoint
    277287    }
    278  
     288
    279289}
  • code/trunk/src/orxonox/controllers/ArtificialController.h

    r9016 r9252  
    4242            virtual ~ArtificialController();
    4343
     44            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     45
    4446            void abandonTarget(Pawn* target);
    4547
     
    6264            void manageWaypoints();
    6365
    64            
     66
    6567
    6668        protected:
    67            
     69
    6870            void aimAtTarget();
    6971
  • code/trunk/src/orxonox/controllers/WaypointController.cc

    r8891 r9252  
    3030
    3131#include "core/CoreIncludes.h"
    32 #include "core/XMLPort.h"
    3332#include "worldentities/ControllableEntity.h"
    3433
     
    5251    }
    5352
    54     void WaypointController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    55     {
    56         SUPER(WaypointController, XMLPort, xmlelement, mode);
    57 
    58         XMLPortParam(ArtificialController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
    59         XMLPortObject(ArtificialController, WorldEntity, "waypoints", addWaypoint, getWaypoint,  xmlelement, mode);
    60     }
    61 
    6253    void WaypointController::tick(float dt)
    6354    {
  • code/trunk/src/orxonox/controllers/WaypointController.h

    r8891 r9252  
    4444            virtual ~WaypointController();
    4545
    46             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4746            virtual void tick(float dt);
    4847
Note: See TracChangeset for help on using the changeset viewer.