size_t LocationManager::FindLocationsInSector(iEngine* engine, iSector* sector, csList<Location*> &list)
{
    size_t count = 0;
    for(size_t i=0; i<all_locations.GetSize(); i++)
    {
        Location* location = all_locations[i];

        if(location->GetSector(engine) == sector)
        {
            list.PushBack(location);
            count++;
        }
    }
    return count;
}
Example #2
0
size_t psPathNetwork::FindWaypointsInSector(iSector *sector, csList<Waypoint*>& list)
{
    size_t count = 0;
    csPDelArray<Waypoint>::Iterator iter(waypoints.GetIterator());
    Waypoint *wp;

    // Initialize
    while (iter.HasNext())
    {
        wp = iter.Next();

	if ( wp->GetSector(engine) == sector )
        {
           list.PushBack(wp);
           count++;
        }
    }
    return count;
}