From 590f3d8d5cc031c0909241b329ad7f7f18035991 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Tue, 22 Sep 2026 09:21:24 +0800 Subject: feat(desktop): P26 民居立面第二变体(挑檐/木格栅窗/院门)沿河沿路交替 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/LivingVillage.Desktop.Tests/PrototypeTests.fs | 26 +++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src/LivingVillage.Desktop.Tests') 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 @@ -1103,6 +1103,23 @@ type PrototypeTests () = Assert.AreEqual(digestOfV1, PerformanceProbe.WorldDigestOfText v2Text) // 953775FA 硬对齐由 --performance-baseline 于 finalWorld 支线证据。 + [] + 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") + [] member _.JiangnanArtAssetsArePackagedAsRealPngFiles () = let requiredAssets = @@ -1116,9 +1133,10 @@ type PrototypeTests () = Assert.AreEqual([], 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(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(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") [] -- cgit v1.2.3