Skip to content

Commit

Permalink
Merge pull request #138 from VATSIM-UK/136-ground-network-coordinates
Browse files Browse the repository at this point in the history
fix(groundnetwork): output coordinates in the ground network
  • Loading branch information
AndyTWF authored Apr 4, 2021
2 parents 08ddb84 + 65f4638 commit 7292454
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Compiler/Model/GroundNetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ List<GroundNetworkRunwayExit> runwayExits

public IEnumerable<ICompilableElement> GetCompilableElements()
{
return Taxiways.Concat<ICompilableElement>(RunwayExits);
List<ICompilableElement> values = new();
Taxiways.ForEach(taxiway => values.AddRange(taxiway.GetCompilableElements()));
RunwayExits.ForEach(exit => values.AddRange(exit.GetCompilableElements()));
return values;
}
}
}
}
15 changes: 14 additions & 1 deletion tests/CompilerTest/Model/GroundNetworkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,23 @@ public void TestItReturnsCompilableElements()
var expected = new List<ICompilableElement>
{
taxiway1,
taxiway1.Coordinates[0],
taxiway1.Coordinates[1],
taxiway1.Coordinates[2],
taxiway2,
taxiway2.Coordinates[0],
taxiway2.Coordinates[1],
taxiway2.Coordinates[2],
exit1,
exit2
exit1.Coordinates[0],
exit1.Coordinates[1],
exit1.Coordinates[2],
exit2,
exit2.Coordinates[0],
exit2.Coordinates[1],
exit2.Coordinates[2],
};

Assert.Equal(expected, network.GetCompilableElements());
}
}
Expand Down

0 comments on commit 7292454

Please sign in to comment.