Update to 14.0-beta3

This commit is contained in:
dP
2024-02-07 13:59:10 +05:30
parent 33ef333b57
commit 910fa762b9
200 changed files with 3470 additions and 4280 deletions

View File

@@ -17,9 +17,6 @@
#include "landscape_type.h"
#include "core/bitmath_func.hpp"
/** Globally unique label of a cargo type. */
typedef uint32_t CargoLabel;
/** Town growth effect when delivering cargo. */
enum TownAcceptanceEffect : byte {
TAE_BEGIN = 0,
@@ -194,8 +191,11 @@ struct CargoSpec {
private:
static CargoSpec array[NUM_CARGO]; ///< Array holding all CargoSpecs
static inline std::map<CargoLabel, CargoID> label_map{}; ///< Translation map from CargoLabel to Cargo ID.
friend void SetupCargoForClimate(LandscapeID l);
friend void BuildCargoLabelMap();
friend inline CargoID GetCargoIDByLabel(CargoLabel ct);
friend void FinaliseCargoArray();
};
@@ -203,9 +203,17 @@ extern CargoTypes _cargo_mask;
extern CargoTypes _standard_cargo_mask;
void SetupCargoForClimate(LandscapeID l);
CargoID GetCargoIDByLabel(CargoLabel cl);
bool IsDefaultCargo(CargoID cid);
void BuildCargoLabelMap();
CargoID GetCargoIDByBitnum(uint8_t bitnum);
CargoID GetDefaultCargoID(LandscapeID l, CargoType ct);
inline CargoID GetCargoIDByLabel(CargoLabel label)
{
auto found = CargoSpec::label_map.find(label);
if (found != std::end(CargoSpec::label_map)) return found->second;
return INVALID_CARGO;
}
Dimension GetLargestCargoIconSize();
void InitializeSortedCargoSpecs();