Changeset 8891 for code/trunk/src/orxonox/controllers/WaypointController.cc
- Timestamp:
- Oct 12, 2011, 7:50:43 PM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/orxonox/controllers/WaypointController.cc
r5929 r8891 40 40 { 41 41 RegisterObject(WaypointController); 42 43 this->currentWaypoint_ = 0;44 42 this->setAccuracy(100); 45 43 } … … 47 45 WaypointController::~WaypointController() 48 46 { 49 if (this->isInitialized())47 for (size_t i = 0; i < this->waypoints_.size(); ++i) 50 48 { 51 for (size_t i = 0; i < this->waypoints_.size(); ++i)49 if(this->waypoints_[i]) 52 50 this->waypoints_[i]->destroy(); 53 51 } … … 58 56 SUPER(WaypointController, XMLPort, xmlelement, mode); 59 57 60 XMLPortParam( WaypointController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);61 XMLPortObject( WaypointController, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode);58 XMLPortParam(ArtificialController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f); 59 XMLPortObject(ArtificialController, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode); 62 60 } 63 61 … … 76 74 } 77 75 78 void WaypointController::addWaypoint(WorldEntity* waypoint)79 {80 this->waypoints_.push_back(waypoint);81 }82 83 WorldEntity* WaypointController::getWaypoint(unsigned int index) const84 {85 if (index < this->waypoints_.size())86 return this->waypoints_[index];87 else88 return 0;89 }90 76 }
Note: See TracChangeset
for help on using the changeset viewer.