summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop.Tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/LivingVillage.Desktop.Tests')
-rw-r--r--src/LivingVillage.Desktop.Tests/PrototypeTests.fs26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
index e58139c..a38228f 100644
--- a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
+++ b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs
@@ -1104,6 +1104,23 @@ type PrototypeTests () =
// 953775FA 硬对齐由 --performance-baseline 于 finalWorld 支线证据。
[<TestMethod>]
+ member _.HouseFacadeVariantsAlternateAlongTheVillage () =
+ // P26:512 大图上两种民居立面都要出现,且按位置确定性交替(纯函数)。
+ let map = MapGen.generateWithSize 512 384 (uint64 4242)
+ let variants = map.Buildings |> List.map VillageArt.houseFacadeVariant
+ Assert.IsTrue(Set.ofList variants |> Set.contains 0, "variant A must appear")
+ Assert.IsTrue(Set.ofList variants |> Set.contains 1, "variant B must appear")
+ let repeated = MapGen.generateWithSize 512 384 (uint64 4242)
+ Assert.AreEqual<(int list)>(variants, repeated.Buildings |> List.map VillageArt.houseFacadeVariant)
+ // Neighbouring buildings along the same river bank must flip variant, i.e. not one solid run.
+ let flipped =
+ variants
+ |> List.pairwise
+ |> List.filter (fun (a, b) -> a <> b)
+ |> List.length
+ Assert.IsTrue(flipped > 0, "facades must alternate, not stay one variant")
+
+ [<TestMethod>]
member _.JiangnanArtAssetsArePackagedAsRealPngFiles () =
let requiredAssets =
[ "Assets/jiangnan-world.png"
@@ -1116,9 +1133,10 @@ type PrototypeTests () =
Assert.AreEqual<string list>([], missing, sprintf "Missing Jiangnan PNG assets: %s" (String.concat ", " missing))
- // The baked world atlas must match the 28-slot layout the renderer indexes into
- // (P17 added 石灯笼/水缸/摊贩摊位 as slots 25..27).
- Assert.AreEqual<int>(28, VillageArt.worldTileCount)
+ // The baked world atlas must match the 31-slot layout the renderer indexes into
+ // (P17 added 石灯笼/水缸/摊贩摊位 as slots 25..27; P26 added the variant-B house
+ // parts 屋檐挑出/木格栅窗/院门 as slots 28..30).
+ Assert.AreEqual<int>(31, VillageArt.worldTileCount)
let worldPath = Path.Combine(AppContext.BaseDirectory, "Assets/jiangnan-world.png")
let header = File.ReadAllBytes worldPath
let be32 offset =
@@ -1128,7 +1146,7 @@ type PrototypeTests () =
||| int header.[offset + 3]
let atlasWidth : int = be32 16
let atlasHeight : int = be32 20
- Assert.IsTrue((atlasWidth = VillageArt.worldAtlasWidth), "world atlas width must match 28 x 32px slots")
+ Assert.IsTrue((atlasWidth = VillageArt.worldAtlasWidth), "world atlas width must match 31 x 32px slots")
Assert.IsTrue((atlasHeight = VillageArt.worldAtlasHeight), "world atlas height must stay 32px")
[<TestMethod>]