Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 12, 2011, 7:50:43 PM (13 years ago)
Author:
jo
Message:

Ai and tutorial improvements merged back to the trunk. AI features: all weapons are used, the ai-firestrength is configurable, bots are able to collect pickups . I've set the tutorial level as default level.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/controllers/WaypointController.cc

    r5929 r8891  
    4040    {
    4141        RegisterObject(WaypointController);
    42 
    43         this->currentWaypoint_ = 0;
    4442        this->setAccuracy(100);
    4543    }
     
    4745    WaypointController::~WaypointController()
    4846    {
    49         if (this->isInitialized())
     47        for (size_t i = 0; i < this->waypoints_.size(); ++i)
    5048        {
    51             for (size_t i = 0; i < this->waypoints_.size(); ++i)
     49            if(this->waypoints_[i])
    5250                this->waypoints_[i]->destroy();
    5351        }
     
    5856        SUPER(WaypointController, XMLPort, xmlelement, mode);
    5957
    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);
    6260    }
    6361
     
    7674    }
    7775
    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     }
    9076}
Note: See TracChangeset for help on using the changeset viewer.