(svn r14529) -Codechange: Turn FindCatchmentRadius() into Station::GetCatchmentRadius().

This commit is contained in:
frosch
2008-10-25 14:19:09 +00:00
parent a14ad77a36
commit 11ef57d81e
3 changed files with 26 additions and 20 deletions

View File

@@ -246,6 +246,28 @@ bool Station::IsBuoy() const
return (had_vehicle_of_type & HVOT_BUOY) != 0;
}
/** Determines the catchment radius of the station
* @return The radius
*/
uint Station::GetCatchmentRadius() const
{
uint ret = CA_NONE;
if (_settings_game.station.modified_catchment) {
if (this->bus_stops != NULL) ret = max<uint>(ret, CA_BUS);
if (this->truck_stops != NULL) ret = max<uint>(ret, CA_TRUCK);
if (this->train_tile != 0) ret = max<uint>(ret, CA_TRAIN);
if (this->dock_tile != 0) ret = max<uint>(ret, CA_DOCK);
if (this->airport_tile != 0) ret = max<uint>(ret, this->Airport()->catchment);
} else {
if (this->bus_stops != NULL || this->truck_stops != NULL || this->train_tile != 0 || this->dock_tile != 0 || this->airport_tile != 0) {
ret = CA_UNMODIFIED;
}
}
return ret;
}
/************************************************************************/
/* StationRect implementation */