Tidal reach plan format

- Add ReachStyle.TIDAL with code 6, rastered as WaterRole.INLET with sea fluid
- Add a tidal tier to the settings, built from the river tier and the inlet bank knobs
- Remove the inlet section from WindowPlan, HydrologyPlanCodec and HydrologyPlanPreview
- Require tidal reaches to be whole, at sea level and draining to the sea
- Record, search and draw inlets from tidal reaches
This commit is contained in:
Brian Fopiano committed 2026-11-03 14:24:50 -05:00
1 parent 10fccd68f3
commit 5d127baac9
35 files changed
+253 -494

No files matched your search

@@ -23,7 +23,7 @@ final class HydrologyUnderground {
static Source generated(Engine engine, ExecutorService workers) {
return (key, plan) -> {
SeaInletProbe.Checks inlets = SeaInletProbe.check(engine, plan.inlets(), workers);
SeaInletProbe.Checks inlets = SeaInletProbe.check(engine, List.of(), workers);
int minChunkX = key.wx() * HydrologyWindows.CHUNKS;
int minChunkZ = key.wz() * HydrologyWindows.CHUNKS;
CavePoolProbe.Counts pools = CavePoolProbe.check(engine, new CavePoolProbe.Area(minChunkX, minChunkX + HydrologyWindows.CHUNKS - 1,
@@ -350,7 +350,7 @@ public class HydrologyMetricsTest {
}
private static WindowPlan plan(WindowKey key, List<Reach> reaches, List<Pond> ponds) {
return new WindowPlan(key, reaches, ponds, List.of());
return new WindowPlan(key, reaches, ponds);
}
private static Reach reach(long id, HydrologyTier tier, long downstream, float catchment, int[] grade, float... coordinates) {
@@ -57,7 +57,7 @@ public class RiverTransectProbeTest {
RiverTransectProbe.Section section = RiverTransectProbe.section(reach, 5,
(x, z) -> new RiverTransectProbe.Column(70, 66, Math.abs(z - 100) <= 2 ? 68 : RiverTransectProbe.NO_WATER, WaterRole.CHANNEL));
List<String> summary = RiverTransectProbe.summary(new WindowKey(0, 0),
new WindowPlan(new WindowKey(0, 0), List.of(reach), List.of(), List.of()), List.of(),
new WindowPlan(new WindowKey(0, 0), List.of(reach), List.of()), List.of(),
List.of(section), settings);
assertEquals("window 0,0 reaches=1 ponds=0 lakes=0 sections=1", summary.get(0));
assertTrue(summary.get(1), summary.get(1).startsWith("reach 7 tier=stream length=40 from=0,100@70 to=40,100@60"));
@@ -45,7 +45,7 @@ final class SyntheticHydrology implements AutoCloseable {
}
HydrologyProbe.Inputs inputs(UnaryOperator<HydrologyVoxels.ChunkBlocks> edit) {
return inputs(edit, (key, plan) -> new HydrologyUnderground.Counts(plan.inlets().size(), 0L, 0, 0L, List.of()));
return inputs(edit, (key, plan) -> new HydrologyUnderground.Counts(0, 0L, 0, 0L, List.of()));
}
HydrologyProbe.Inputs inputs(UnaryOperator<HydrologyVoxels.ChunkBlocks> edit, HydrologyUnderground.Source underground) {