From a7b694451c83c460c6e343886004524ff214796e Mon Sep 17 00:00:00 2001 From: Dmytro Muravskyi Date: Thu, 14 Dec 2023 11:13:08 +0200 Subject: [PATCH] Add Exception, remove unused default parameters --- TravelDistanceAnalyzer/src/AdaptiveGridBuilder.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/TravelDistanceAnalyzer/src/AdaptiveGridBuilder.cs b/TravelDistanceAnalyzer/src/AdaptiveGridBuilder.cs index ee4a5379..73a1d4ab 100644 --- a/TravelDistanceAnalyzer/src/AdaptiveGridBuilder.cs +++ b/TravelDistanceAnalyzer/src/AdaptiveGridBuilder.cs @@ -30,8 +30,8 @@ public AdaptiveGridBuilder() public AdaptiveGrid Build(IEnumerable corridors, IEnumerable rooms, - IEnumerable? walls = null, - IEnumerable? doors = null) + IEnumerable? walls, + IEnumerable? doors) { foreach (var item in corridors) { @@ -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;