(svn r25150) -Fix [FS#5514]: [Script] The was no way to differentiate between a cargo-station combination with or without rating, so introduce [AI|GS]Station::HasRating and let GetRating return -1 when there is no rating

This commit is contained in:
rubidium
2013-04-06 12:36:33 +00:00
parent b2292122b6
commit 7a3d549f2f
7 changed files with 38 additions and 4 deletions

View File

@@ -86,12 +86,23 @@ public:
*/
static int32 GetCargoWaiting(StationID station_id, CargoID cargo_id);
/**
* Check whether the given cargo at the given station a rating.
* @param station_id The station to get the cargo-rating state of.
* @param cargo_id The cargo to get the cargo-rating state of.
* @pre IsValidStation(station_id).
* @pre IsValidCargo(cargo_id).
* @return True if the cargo has a rating, otherwise false.
*/
static bool HasCargoRating(StationID station_id, CargoID cargo_id);
/**
* See how high the rating is of a cargo on a station.
* @param station_id The station to get the cargo-rating of.
* @param cargo_id The cargo to get the cargo-rating of.
* @pre IsValidStation(station_id).
* @pre IsValidCargo(cargo_id).
* @pre HasCargoRating(station_id, cargo_id).
* @return The rating in percent of the cargo on the station.
*/
static int32 GetCargoRating(StationID station_id, CargoID cargo_id);