Use independent street and avenue settings

This commit is contained in:
2026-09-27 08:11:52 -07:00
parent d68f7543ea
commit 8d99c2e67f
14 changed files with 425 additions and 161 deletions

View File

@@ -104,6 +104,25 @@ class AvenueStairwayLayoutTest {
new AvenueStairwayLayout.Step(-1, 63, 48), flights.getLast().stairBlocks().getFirst());
}
@Test
void createsStreetFlightsAlongXOnBothNorthAndSouthBorders() {
Cuboid twoByTwoPlot = new Cuboid(2, 62, 2, 69, 71, 69);
List<AvenueStairwayLayout.Flight> flights =
AvenueStairwayLayout.forUpperStreetSegments(twoByTwoPlot, 32, 36, 0, 1, 4, 2, 62, 14, 3);
assertEquals(4, flights.size());
assertEquals(AvenueStairwayLayout.Side.NORTH, flights.getFirst().side());
assertEquals(
new AvenueStairwayLayout.Step(12, 63, -1), flights.getFirst().stairBlocks().getFirst());
assertEquals(AvenueStairwayLayout.Side.SOUTH, flights.get(1).side());
assertEquals(
new AvenueStairwayLayout.Step(12, 63, 71), flights.get(1).stairBlocks().getFirst());
assertEquals(
new AvenueStairwayLayout.Step(48, 63, -1), flights.get(2).stairBlocks().getFirst());
assertTrue(flights.stream().allMatch(flight -> flight.stairBlocks().getLast().y() == 76));
}
@Test
void rejectsAStairRunThatCannotFitWithinThePlotLength() {
Cuboid plot = new Cuboid(2, 62, 2, 33, 71, 13);