Add: [Script] ScriptCargo::GetName, to get the human readable name of a cargo (#8544)

Of course this translates into AICargo.GetName() for AIs and
GSCargo.GetName() for GameScripts.
This commit is contained in:
Patric Stout
2021-01-09 15:15:14 +01:00
committed by GitHub
parent 3dbdb1c7e3
commit 218f40eea2
6 changed files with 38 additions and 1 deletions

View File

@@ -84,6 +84,14 @@ public:
*/
static bool IsValidTownEffect(TownEffect towneffect_type);
/**
* Get the name of the cargo type.
* @param cargo_type The cargo type to get the name of.
* @pre IsValidCargo(cargo_type).
* @return The name of the cargo type.
*/
static char *GetName(CargoID cargo_type);
/**
* Gets the string representation of the cargo label.
* @param cargo_type The cargo to get the string representation of.