Codechange: rename CargoID to CargoType and amend related variables/comments

This commit is contained in:
Rubidium
2025-01-22 18:08:59 +01:00
committed by rubidium42
parent d05cc2ef92
commit e894a5880c
129 changed files with 1009 additions and 1009 deletions

View File

@@ -79,88 +79,88 @@ public:
/**
* See how much cargo there is waiting on a station.
* @param station_id The station to get the cargo-waiting of.
* @param cargo_id The cargo to get the cargo-waiting of.
* @param cargo_type The cargo to get the cargo-waiting of.
* @pre IsValidStation(station_id).
* @pre IsValidCargo(cargo_id).
* @pre IsValidCargo(cargo_type).
* @return The amount of units waiting at the station.
*/
static SQInteger GetCargoWaiting(StationID station_id, CargoID cargo_id);
static SQInteger GetCargoWaiting(StationID station_id, CargoType cargo_type);
/**
* See how much cargo with a specific source station there is waiting on a station.
* @param station_id The station to get the cargo-waiting of.
* @param from_station_id The source station of the cargo. Pass STATION_INVALID to get cargo of which the source has been deleted.
* @param cargo_id The cargo to get the cargo-waiting of.
* @param cargo_type The cargo to get the cargo-waiting of.
* @pre IsValidStation(station_id).
* @pre IsValidStation(from_station_id) || from_station_id == STATION_INVALID.
* @pre IsValidCargo(cargo_id).
* @pre IsValidCargo(cargo_type).
* @return The amount of units waiting at the station originating from from_station_id.
* @note source station means, the station where cargo was first loaded.
*/
static SQInteger GetCargoWaitingFrom(StationID station_id, StationID from_station_id, CargoID cargo_id);
static SQInteger GetCargoWaitingFrom(StationID station_id, StationID from_station_id, CargoType cargo_type);
/**
* See how much cargo with a specific via-station there is waiting on a station.
* @param station_id The station to get the cargo-waiting of.
* @param via_station_id The next station the cargo is going to. Pass STATION_INVALID to get waiting cargo for "via any station".
* @param cargo_id The cargo to get the cargo-waiting of.
* @param cargo_type The cargo to get the cargo-waiting of.
* @pre IsValidStation(station_id).
* @pre IsValidStation(via_station_id) || via_station_id == STATION_INVALID.
* @pre IsValidCargo(cargo_id).
* @pre IsValidCargo(cargo_type).
* @return The amount of units waiting at the station with via_station_id as next hop.
* @note if ScriptCargo.GetCargoDistributionType(cargo_id) == ScriptCargo.DT_MANUAL, then all waiting cargo will have STATION_INVALID as next hop.
* @note if ScriptCargo.GetCargoDistributionType(cargo_type) == ScriptCargo.DT_MANUAL, then all waiting cargo will have STATION_INVALID as next hop.
*/
static SQInteger GetCargoWaitingVia(StationID station_id, StationID via_station_id, CargoID cargo_id);
static SQInteger GetCargoWaitingVia(StationID station_id, StationID via_station_id, CargoType cargo_type);
/**
* See how much cargo with a specific via-station and source station there is waiting on a station.
* @param station_id The station to get the cargo-waiting of.
* @param from_station_id The source station of the cargo. Pass STATION_INVALID to get cargo of which the source has been deleted.
* @param via_station_id The next station the cargo is going to. Pass STATION_INVALID to get waiting cargo for "via any station".
* @param cargo_id The cargo to get the cargo-waiting of.
* @param cargo_type The cargo to get the cargo-waiting of.
* @pre IsValidStation(station_id).
* @pre IsValidStation(from_station_id) || from_station_id == STATION_INVALID.
* @pre IsValidStation(via_station_id) || via_station_id == STATION_INVALID.
* @pre IsValidCargo(cargo_id).
* @pre IsValidCargo(cargo_type).
* @return The amount of units waiting at the station with from_station_id as source and via_station_id as next hop.
* @note if ScriptCargo.GetCargoDistributionType(cargo_id) == ScriptCargo.DT_MANUAL, then all waiting cargo will have STATION_INVALID as next hop.
* @note if ScriptCargo.GetCargoDistributionType(cargo_type) == ScriptCargo.DT_MANUAL, then all waiting cargo will have STATION_INVALID as next hop.
*/
static SQInteger GetCargoWaitingFromVia(StationID station_id, StationID from_station_id, StationID via_station_id, CargoID cargo_id);
static SQInteger GetCargoWaitingFromVia(StationID station_id, StationID from_station_id, StationID via_station_id, CargoType cargo_type);
/**
* See how much cargo was planned to pass (including production and consumption) this station per month.
* @param station_id The station to get the planned flow for.
* @param cargo_id The cargo type to get the planned flow for.
* @param cargo_type The cargo type to get the planned flow for.
* @pre IsValidStation(station_id).
* @pre IsValidCargo(cargo_id).
* @pre IsValidCargo(cargo_type).
* @return The amount of cargo units planned to pass the station per month.
*/
static SQInteger GetCargoPlanned(StationID station_id, CargoID cargo_id);
static SQInteger GetCargoPlanned(StationID station_id, CargoType cargo_type);
/**
* See how much cargo from the specified origin was planned to pass (including production and consumption) this station per month.
* @param station_id The station to get the planned flow for.
* @param from_station_id The station the cargo originates at.
* @param cargo_id The cargo type to get the planned flow for.
* @param cargo_type The cargo type to get the planned flow for.
* @pre IsValidStation(station_id).
* @pre IsValidStation(from_station_id) || from_station_id == STATION_INVALID.
* @pre IsValidCargo(cargo_id).
* @pre IsValidCargo(cargo_type).
* @return The amount of cargo units from the specified origin planned to pass the station per month.
*/
static SQInteger GetCargoPlannedFrom(StationID station_id, StationID from_station_id, CargoID cargo_id);
static SQInteger GetCargoPlannedFrom(StationID station_id, StationID from_station_id, CargoType cargo_type);
/**
* See how much cargo was planned to pass (including production and consumption) this station per month, heading for the specified next hop.
* @param station_id The station to get the planned flow for.
* @param via_station_id The next station the cargo will go on to.
* @param cargo_id The cargo type to get the planned flow for.
* @param cargo_type The cargo type to get the planned flow for.
* @pre IsValidStation(station_id).
* @pre IsValidStation(via_station_id) || via_station_id == STATION_INVALID.
* @pre IsValidCargo(cargo_id).
* @pre IsValidCargo(cargo_type).
* @return The amount of cargo units planned to pass the station per month, going via the specified next hop.
* @note Cargo planned to go "via" the same station that's being queried is actually planned to be consumed there.
*/
static SQInteger GetCargoPlannedVia(StationID station_id, StationID via_station_id, CargoID cargo_id);
static SQInteger GetCargoPlannedVia(StationID station_id, StationID via_station_id, CargoType cargo_type);
/**
* See how much cargo from the specified origin was planned to pass this station per month,
@@ -168,37 +168,37 @@ public:
* @param station_id The station to get the planned flow for.
* @param from_station_id The station the cargo originates at.
* @param via_station_id The next station the cargo will go on to.
* @param cargo_id The cargo type to get the planned flow for.
* @param cargo_type The cargo type to get the planned flow for.
* @pre IsValidStation(station_id).
* @pre IsValidStation(from_station_id) || from_station_id == STATION_INVALID.
* @pre IsValidStation(via_station_id) || via_station_id == STATION_INVALID.
* @pre IsValidCargo(cargo_id).
* @pre IsValidCargo(cargo_type).
* @return The amount of cargo units from the specified origin planned to pass the station per month, going via the specified next hop.
* @note Cargo planned to go "via" the same station that's being queried is actually planned to be consumed there.
* @note Cargo planned to pass "from" the same station that's being queried is actually produced there.
*/
static SQInteger GetCargoPlannedFromVia(StationID station_id, StationID from_station_id, StationID via_station_id, CargoID cargo_id);
static SQInteger GetCargoPlannedFromVia(StationID station_id, StationID from_station_id, StationID via_station_id, CargoType cargo_type);
/**
* 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.
* @param cargo_type The cargo to get the cargo-rating state of.
* @pre IsValidStation(station_id).
* @pre IsValidCargo(cargo_id).
* @pre IsValidCargo(cargo_type).
* @return True if the cargo has a rating, otherwise false.
*/
static bool HasCargoRating(StationID station_id, CargoID cargo_id);
static bool HasCargoRating(StationID station_id, CargoType cargo_type);
/**
* 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.
* @param cargo_type The cargo to get the cargo-rating of.
* @pre IsValidStation(station_id).
* @pre IsValidCargo(cargo_id).
* @pre HasCargoRating(station_id, cargo_id).
* @pre IsValidCargo(cargo_type).
* @pre HasCargoRating(station_id, cargo_type).
* @return The rating in percent of the cargo on the station.
*/
static SQInteger GetCargoRating(StationID station_id, CargoID cargo_id);
static SQInteger GetCargoRating(StationID station_id, CargoType cargo_type);
/**
* Get the coverage radius of this type of station.
@@ -299,15 +299,15 @@ public:
private:
template <bool Tfrom, bool Tvia>
static bool IsCargoRequestValid(StationID station_id, StationID from_station_id,
StationID via_station_id, CargoID cargo_id);
StationID via_station_id, CargoType cargo_type);
template <bool Tfrom, bool Tvia>
static SQInteger CountCargoWaiting(StationID station_id, StationID from_station_id,
StationID via_station_id, CargoID cargo_id);
StationID via_station_id, CargoType cargo_type);
template <bool Tfrom, bool Tvia>
static SQInteger CountCargoPlanned(StationID station_id, StationID from_station_id,
StationID via_station_id, CargoID cargo_id);
StationID via_station_id, CargoType cargo_type);
};