Codechange: Extract code to build cargo acceptance string for re-use.

This commit is contained in:
Peter Nelson
2024-05-17 21:51:49 +01:00
committed by Peter Nelson
parent 2ede94bc40
commit 041b9181f9
3 changed files with 43 additions and 23 deletions

View File

@@ -214,6 +214,8 @@ void SetupCargoForClimate(LandscapeID l);
bool IsDefaultCargo(CargoID cid);
void BuildCargoLabelMap();
std::optional<std::string> BuildCargoAcceptanceString(const CargoArray &acceptance, StringID label);
inline CargoID GetCargoIDByLabel(CargoLabel label)
{
auto found = CargoSpec::label_map.find(label);