Commit 99cd0f6f authored by Katelyn Gigante's avatar Katelyn Gigante
Browse files

Log if we've double-assigned an exit

parent 02be7978
......@@ -174,8 +174,17 @@
_logger.LogWarning($"Unknown location {locationB} encountered in links");
return; // abort
}
if (canGoAToB) locations[locationA].SetNeighbour(dirAToB, locationB);
if (canGoBToA) locations[locationB].SetNeighbour(dirBToA, locationA);
if (canGoAToB)
{
if (!string.IsNullOrEmpty(locations[locationA].GetNeighbour(dirAToB))) _logger.LogWarning($"Overwriting link {locationA} {dirAToB} ({locations[locationA].GetNeighbour(dirAToB)}->{locationB})");
locations[locationA].SetNeighbour(dirAToB, locationB);
}
if (canGoBToA)
{
if (!string.IsNullOrEmpty(locations[locationB].GetNeighbour(dirBToA))) _logger.LogWarning($"Overwriting link {locationB} {dirBToA} ({locations[locationB].GetNeighbour(dirBToA)}->{locationA})");
locations[locationB].SetNeighbour(dirBToA, locationA);
}
}
// Generate a new concrete arrangement of locations
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment