function Utils::GetStationCoverageCargoProduction(stationId, cargoClass) {
local tileList = AITileList();
local stationTiles = AITileList_StationType(stationId, AIStation.STATION_ANY);
local airportTiles = AITileList_StationType(stationId, AIStation.STATION_AIRPORT);
airportTiles.Sort(AIList.SORT_BY_ITEM, AIList.SORT_ASCENDING);
local airport_tile = airportTiles.Count() == 0 ? AIMap.TILE_INVALID : airportTiles.Begin();
for (local tile = stationTiles.Begin(); !stationTiles.IsEnd(); tile = stationTiles.Next()) {
if (!AIAirport.IsAirportTile(tile)) {
local type = cargoClass == AICargo.CC_PASSENGERS ? AIStation.STATION_BUS_STOP : AIStation.STATION_TRUCK_STOP;
local radius = AIStation.GetCoverageRadius(type);
tileList.AddRectangle(Utils.getValidOffsetTile(tile, -radius, -radius), Utils.getValidOffsetTile(tile, radius, radius));
} else if (AIMap.IsValidTile(airport_tile) && tile == airport_tile) {
local type = AIAirport.GetAirportType(tile);
local radius = AIAirport.GetAirportCoverageRadius(type);
local width = AIAirport.GetAirportWidth(type);
local height = AIAirport.GetAirportHeight(type);
tileList.AddRectangle(Utils.getValidOffsetTile(tile, -radius, -radius), Utils.getValidOffsetTile(AIMap.GetTileIndex(AIMap.GetTileX(tile) + width - 1, AIMap.GetTileY(tile) + height - 1), radius, radius));
}
}
local removeTiles = AITileList();
for (local remove_tile = tileList.Begin(); !tileList.IsEnd(); remove_tile = tileList.Next()) {
if (stationTiles.HasItem(remove_tile)) {
removeTiles.AddTile(remove_tile);
}
}
tileList.RemoveList(removeTiles);
for (local tile = tileList.Begin(); !tileList.IsEnd(); tile = tileList.Next()) {
AISign.BuildSign(tile, "x");
}
// TODO - how to compute cargo production of each tile in tileList
}