mirror of https://github.com/OpenTTD/OpenTTD.git
Codechange: Remove DistributionTypeByte
This commit is contained in:
parent
a5681d3eba
commit
bd87f11355
|
@ -21,7 +21,7 @@ static const LinkGraphID INVALID_LINK_GRAPH_JOB = UINT16_MAX;
|
||||||
typedef uint16 NodeID;
|
typedef uint16 NodeID;
|
||||||
static const NodeID INVALID_NODE = UINT16_MAX;
|
static const NodeID INVALID_NODE = UINT16_MAX;
|
||||||
|
|
||||||
enum DistributionType {
|
enum DistributionType : byte {
|
||||||
DT_BEGIN = 0,
|
DT_BEGIN = 0,
|
||||||
DT_MIN = 0,
|
DT_MIN = 0,
|
||||||
DT_MANUAL = 0, ///< Manual distribution. No link graph calculations are run.
|
DT_MANUAL = 0, ///< Manual distribution. No link graph calculations are run.
|
||||||
|
@ -37,7 +37,6 @@ enum DistributionType {
|
||||||
* Define basic enum properties
|
* Define basic enum properties
|
||||||
*/
|
*/
|
||||||
template <> struct EnumPropsT<DistributionType> : MakeEnumPropsT<DistributionType, byte, DT_BEGIN, DT_END, DT_NUM> {};
|
template <> struct EnumPropsT<DistributionType> : MakeEnumPropsT<DistributionType, byte, DT_BEGIN, DT_END, DT_NUM> {};
|
||||||
typedef TinyEnumT<DistributionType> DistributionTypeByte; // typedefing-enumification of DistributionType
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Special modes for updating links. 'Restricted' means that vehicles with
|
* Special modes for updating links. 'Restricted' means that vehicles with
|
||||||
|
|
|
@ -493,16 +493,16 @@ struct EconomySettings {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LinkGraphSettings {
|
struct LinkGraphSettings {
|
||||||
uint16 recalc_time; ///< time (in days) for recalculating each link graph component.
|
uint16 recalc_time; ///< time (in days) for recalculating each link graph component.
|
||||||
uint16 recalc_interval; ///< time (in days) between subsequent checks for link graphs to be calculated.
|
uint16 recalc_interval; ///< time (in days) between subsequent checks for link graphs to be calculated.
|
||||||
DistributionTypeByte distribution_pax; ///< distribution type for passengers
|
DistributionType distribution_pax; ///< distribution type for passengers
|
||||||
DistributionTypeByte distribution_mail; ///< distribution type for mail
|
DistributionType distribution_mail; ///< distribution type for mail
|
||||||
DistributionTypeByte distribution_armoured; ///< distribution type for armoured cargo class
|
DistributionType distribution_armoured; ///< distribution type for armoured cargo class
|
||||||
DistributionTypeByte distribution_default; ///< distribution type for all other goods
|
DistributionType distribution_default; ///< distribution type for all other goods
|
||||||
uint8 accuracy; ///< accuracy when calculating things on the link graph. low accuracy => low running time
|
uint8 accuracy; ///< accuracy when calculating things on the link graph. low accuracy => low running time
|
||||||
uint8 demand_size; ///< influence of supply ("station size") on the demand function
|
uint8 demand_size; ///< influence of supply ("station size") on the demand function
|
||||||
uint8 demand_distance; ///< influence of distance between stations on the demand function
|
uint8 demand_distance; ///< influence of distance between stations on the demand function
|
||||||
uint8 short_path_saturation; ///< percentage up to which short paths are saturated before saturating most capacious paths
|
uint8 short_path_saturation; ///< percentage up to which short paths are saturated before saturating most capacious paths
|
||||||
|
|
||||||
inline DistributionType GetDistributionType(CargoID cargo) const {
|
inline DistributionType GetDistributionType(CargoID cargo) const {
|
||||||
if (IsCargoInClass(cargo, CC_PASSENGERS)) return this->distribution_pax;
|
if (IsCargoInClass(cargo, CC_PASSENGERS)) return this->distribution_pax;
|
||||||
|
|
Loading…
Reference in New Issue