move the shared TOML helpers into the utility namespace to avoid name collisions
This commit is contained in:
@@ -46,11 +46,11 @@ void validateUnlocks(const GameConfig& cfg)
|
||||
{
|
||||
if (valid.count(id) == 0)
|
||||
{
|
||||
throw makeError(file, gPath, "grants unknown " + kind + " '" + id + "'");
|
||||
throw utility::makeError(file, gPath, "grants unknown " + kind + " '" + id + "'");
|
||||
}
|
||||
if (!granted.insert(id).second)
|
||||
{
|
||||
throw makeError(file, gPath,
|
||||
throw utility::makeError(file, gPath,
|
||||
"grants " + kind + " '" + id + "' which is already granted by another unlock group");
|
||||
}
|
||||
}
|
||||
@@ -61,13 +61,13 @@ void validateUnlocks(const GameConfig& cfg)
|
||||
const std::string gPath = "unlock '" + group.id + "'";
|
||||
if (!groupIds.insert(group.id).second)
|
||||
{
|
||||
throw makeError(file, gPath, "duplicate unlock group id");
|
||||
throw utility::makeError(file, gPath, "duplicate unlock group id");
|
||||
}
|
||||
|
||||
if (group.ships.empty() && group.modules.empty()
|
||||
&& group.buildings.empty() && group.recipes.empty())
|
||||
{
|
||||
throw makeError(file, gPath, "grants no items (must grant at least one)");
|
||||
throw utility::makeError(file, gPath, "grants no items (must grant at least one)");
|
||||
}
|
||||
|
||||
checkGrants(group.ships, shipIds, grantedShipIds, "ship", gPath);
|
||||
@@ -83,7 +83,7 @@ void validateUnlocks(const GameConfig& cfg)
|
||||
{
|
||||
if (groupIds.count(req) == 0)
|
||||
{
|
||||
throw makeError(file, "unlock '" + group.id + "'.requires",
|
||||
throw utility::makeError(file, "unlock '" + group.id + "'.requires",
|
||||
"references unknown unlock group '" + req + "'");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user