Skip to content

Commit

Permalink
Add Exception, remove unused default parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroMuravskyi committed Dec 14, 2023
1 parent e85ee87 commit a7b6944
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions TravelDistanceAnalyzer/src/AdaptiveGridBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public AdaptiveGridBuilder()

public AdaptiveGrid Build(IEnumerable<CirculationSegment> corridors,
IEnumerable<SpaceBoundary> rooms,
IEnumerable<WallCandidate>? walls = null,
IEnumerable<Door>? doors = null)
IEnumerable<WallCandidate>? walls,
IEnumerable<Door>? doors)
{
foreach (var item in corridors)
{
Expand Down Expand Up @@ -106,6 +106,11 @@ public ulong AddEndPoint(Vector3 exit, double snapDistance)

private void AdditionalConnections(GridVertex exit)
{
if (!exit.Edges.Any())
{
throw new Exception("Free vertices should not be present in the grid");
}

if (exit.Edges.Count > 2)
{
return;
Expand Down

0 comments on commit a7b6944

Please sign in to comment.