Show total building block cost in multi-selection panel (relevant for temporary blueprint)

This commit is contained in:
2026-07-13 20:31:40 +02:00
parent 92e896b973
commit 69fe607157
4 changed files with 28 additions and 17 deletions

View File

@@ -31,4 +31,18 @@ struct BuildingDef
struct BuildingsConfig
{
std::vector<BuildingDef> buildings;
// Returns the definition for the given building type, or nullptr if the
// type has no entry in buildings.toml.
const BuildingDef* findBuildingDef(BuildingType type) const
{
for (const BuildingDef& def : buildings)
{
if (def.type == type)
{
return &def;
}
}
return nullptr;
}
};