Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 21, 2011, 5:36:37 PM (14 years ago)
Author:
jo
Message:

Moved intern waypoint functionallity from the waypointController to its base class ArtificialController. Further usage of this is planned.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai2/src/orxonox/controllers/WaypointController.cc

    r5929 r8769  
    4040    {
    4141        RegisterObject(WaypointController);
    42 
    43         this->currentWaypoint_ = 0;
    44         this->setAccuracy(100);
    4542    }
    4643
    4744    WaypointController::~WaypointController()
    4845    {
    49         if (this->isInitialized())
    50         {
    51             for (size_t i = 0; i < this->waypoints_.size(); ++i)
    52                 this->waypoints_[i]->destroy();
    53         }
    5446    }
    5547
     
    5850        SUPER(WaypointController, XMLPort, xmlelement, mode);
    5951
    60         XMLPortParam(WaypointController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
    61         XMLPortObject(WaypointController, WorldEntity, "waypoints", addWaypoint, getWaypoint,  xmlelement, mode);
     52        XMLPortParam(ArtificialController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
     53        XMLPortObject(ArtificialController, WorldEntity, "waypoints", addWaypoint, getWaypoint,  xmlelement, mode);
    6254    }
    6355
     
    7668    }
    7769
    78     void WaypointController::addWaypoint(WorldEntity* waypoint)
    79     {
    80         this->waypoints_.push_back(waypoint);
    81     }
    82 
    83     WorldEntity* WaypointController::getWaypoint(unsigned int index) const
    84     {
    85         if (index < this->waypoints_.size())
    86             return this->waypoints_[index];
    87         else
    88             return 0;
    89     }
    9070}
Note: See TracChangeset for help on using the changeset viewer.