summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop.Tests
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-22 11:17:43 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-22 11:17:43 +0800
commit26afb04feb9a7bec3162eccf64f1df04bfda4def (patch)
tree021336460e96fea0046bd3be0f21751f073435c1 /src/LivingVillage.Desktop.Tests
parentda11e3507f63b9126d534399e9b29fc2615ed481 (diff)
downloadliving-village-26afb04feb9a7bec3162eccf64f1df04bfda4def.tar.gz
feat(mapgen): P28 512 沿河民居加密至 16 并宽度 2/3/4 分层
- ExtraRiversideHouses 10 -> 16(沿河 +6 座),宽度加权 2/3/4 形成聚落层次 - 仅 large 分支执行、默认图不消耗 RNG:64x48=6042052、256x192=1284656962 锁定不变 - 新增 LargeMapHouseDensityHierarchyOnlyGrowsLargeMaps 回归
Diffstat (limited to 'src/LivingVillage.Desktop.Tests')
-rw-r--r--src/LivingVillage.Desktop.Tests/MapGenTests.fs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/LivingVillage.Desktop.Tests/MapGenTests.fs b/src/LivingVillage.Desktop.Tests/MapGenTests.fs
index 6486dd7..b737707 100644
--- a/src/LivingVillage.Desktop.Tests/MapGenTests.fs
+++ b/src/LivingVillage.Desktop.Tests/MapGenTests.fs
@@ -256,6 +256,21 @@ type MapGenTests () =
Assert.IsTrue(a.Buildings = b.Buildings)
Assert.AreEqual<string>(MapGen.serialize a, MapGen.serialize b)
+ /// P28:512 沿河民居由 10 -> 16 增密(+6),并出现 2/3/4 三档宽度(附属小筑/民居/大宅),
+ /// 形成聚落层次;默认图仍为 0,不消耗 RNG,故 64/256 checksum 锁定不变。
+ [<TestMethod>]
+ member _.LargeMapHouseDensityHierarchyOnlyGrowsLargeMaps () =
+ Assert.AreEqual<int>(16, (MapGen.paramsForSize 512 384 (uint64 1)).ExtraRiversideHouses)
+ Assert.AreEqual<int>(0, (MapGen.paramsForSize 64 48 (uint64 1)).ExtraRiversideHouses)
+ Assert.AreEqual<int>(0, (MapGen.paramsForSize 256 192 (uint64 1)).ExtraRiversideHouses)
+ let map = MapGen.generateWithSize 512 384 (uint64 4242)
+ Assert.IsTrue(map.Buildings.Length >= 22, sprintf "P28 512 must place >=22 houses, saw %d" map.Buildings.Length)
+ let widths = map.Buildings |> List.map (fun b -> b.Width) |> Set.ofList
+ Assert.IsTrue(widths.Contains 2, "outbuilding width 2 must appear")
+ Assert.IsTrue(widths.Contains 3, "house width 3 must appear")
+ Assert.IsTrue(widths.Contains 4, "hall width 4 must appear")
+ Assert.AreEqual<int>(24, map.Buildings.Length)
+
[<TestMethod>]
member _.DefaultSizeHouseCountUnchanged () =
Assert.AreEqual<int>(4, (MapGen.generateWithSize 64 48 (uint64 4242)).Buildings.Length)