Codechange: strongly type CargoPayment

This commit is contained in:
Rubidium 2025-01-31 21:27:24 +01:00 committed by rubidium42
parent 07dd5bf01d
commit 4803ca7462
2 changed files with 3 additions and 2 deletions

View File

@ -14,7 +14,7 @@
#include "company_type.h" #include "company_type.h"
/** Type of pool to store cargo payments in; little over 1 million. */ /** Type of pool to store cargo payments in; little over 1 million. */
typedef Pool<CargoPayment, CargoPaymentID, 512, 0xFF000> CargoPaymentPool; using CargoPaymentPool = Pool<CargoPayment, CargoPaymentID, 512, CargoPaymentID::End().base()>;
/** The actual pool to store cargo payments in. */ /** The actual pool to store cargo payments in. */
extern CargoPaymentPool _cargo_payment_pool; extern CargoPaymentPool _cargo_payment_pool;

View File

@ -12,6 +12,7 @@
#include "core/overflowsafe_type.hpp" #include "core/overflowsafe_type.hpp"
#include "core/enum_type.hpp" #include "core/enum_type.hpp"
#include "core/pool_type.hpp"
typedef OverflowSafeInt64 Money; typedef OverflowSafeInt64 Money;
@ -254,6 +255,6 @@ static const uint ROAD_STOP_TRACKBIT_FACTOR = 2;
static const uint LOCK_DEPOT_TILE_FACTOR = 2; static const uint LOCK_DEPOT_TILE_FACTOR = 2;
struct CargoPayment; struct CargoPayment;
typedef uint32_t CargoPaymentID; using CargoPaymentID = PoolID<uint32_t, struct CargoPaymentIDTag, 0xFF000, 0xFFFFF>;
#endif /* ECONOMY_TYPE_H */ #endif /* ECONOMY_TYPE_H */