Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef SCRIPT_STATION_HPP
00013 #define SCRIPT_STATION_HPP
00014
00015 #include "script_road.hpp"
00016 #include "script_basestation.hpp"
00017
00022 class ScriptStation : public ScriptBaseStation {
00023 public:
00027 enum ErrorMessages {
00029 ERR_STATION_BASE = ScriptError::ERR_CAT_STATION << ScriptError::ERR_CAT_BIT_SIZE,
00030
00032 ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION,
00033
00035 ERR_STATION_TOO_MANY_STATIONS,
00036
00038 ERR_STATION_TOO_MANY_STATIONS_IN_TOWN,
00039 };
00040
00044 enum StationType {
00045
00046 STATION_TRAIN = 0x01,
00047 STATION_TRUCK_STOP = 0x02,
00048 STATION_BUS_STOP = 0x04,
00049 STATION_AIRPORT = 0x08,
00050 STATION_DOCK = 0x10,
00051 STATION_ANY = 0x1F,
00052 };
00053
00059 static bool IsValidStation(StationID station_id);
00060
00067 static StationID GetStationID(TileIndex tile);
00068
00077 static int32 GetCargoWaiting(StationID station_id, CargoID cargo_id);
00078
00087 static int32 GetCargoRating(StationID station_id, CargoID cargo_id);
00088
00096 static int32 GetCoverageRadius(ScriptStation::StationType station_type);
00097
00104 static int32 GetStationCoverageRadius(StationID station_id);
00105
00114 static int32 GetDistanceManhattanToTile(StationID station_id, TileIndex tile);
00115
00124 static int32 GetDistanceSquareToTile(StationID station_id, TileIndex tile);
00125
00134 static bool IsWithinTownInfluence(StationID station_id, TownID town_id);
00135
00143 static bool HasStationType(StationID station_id, StationType station_type);
00144
00152 static bool HasRoadType(StationID station_id, ScriptRoad::RoadType road_type);
00153
00164 static TownID GetNearestTown(StationID station_id);
00165 };
00166
00167 DECLARE_ENUM_AS_BIT_SET(ScriptStation::StationType)
00168
00169 #endif