From 326575888b9c8edf0ded1dcf1c01f5c78d3eca84 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Mon, 21 Sep 2026 11:12:52 +0800 Subject: feat(desktop): 河畔植被与中式道具点缀 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, 24 insertions(+), 2 deletions(-) (limited to 'src/LivingVillage.Desktop.Tests') diff --git a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs index 7959d27..4d698ad 100644 --- a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs +++ b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs @@ -301,8 +301,30 @@ type PrototypeTests () = Assert.IsTrue(footprint.Contains({ X = door.X + dx; Y = door.Y - 2 } : TilePosition), sprintf "missing ridge tile dx=%d" dx) Assert.IsTrue(footprint.Contains({ X = door.X + dx; Y = door.Y - 1 } : TilePosition), sprintf "missing eave tile dx=%d" dx) Assert.IsTrue(footprint.Contains({ X = door.X + dx; Y = door.Y } : TilePosition), sprintf "missing wall tile dx=%d" dx) - // 12 house tiles + 3 bridge + 3 bamboo + 2 garden. - Assert.AreEqual(20, footprint.Count) + // 12 house + 3 bridge + 3 bamboo + 2 garden + 2x2 willow + 2 shrub + 2 flowers + 2 reeds + 1 bench + 2 lanterns. + Assert.AreEqual(33, footprint.Count) + + [] + member _.VegetationAndRiversidePropsDecorateTheScene () = + let plan = VillageArt.sampleRenderPlan () + let kinds = plan.Props |> List.map (fun prop -> prop.Kind) + let count kind = kinds |> List.filter (fun candidate -> candidate = kind) |> List.length + let grounds = plan.Grounds |> List.map fst |> Set.ofList + + Assert.AreEqual(2, count VillageArt.WillowTree) + Assert.IsTrue(count VillageArt.ShrubPatch >= 2) + Assert.IsTrue(count VillageArt.FlowerBush >= 2) + Assert.AreEqual(2, count VillageArt.ReedCluster) + Assert.AreEqual(1, count VillageArt.StoneBench) + Assert.AreEqual(2, count VillageArt.RiverLantern) + + // Reeds must root in water; lanterns stand on the bank path. + for prop in plan.Props do + let tile = VillageArt.worldTile plan prop.Position + match prop.Kind with + | VillageArt.ReedCluster -> Assert.IsTrue(grounds.Contains(prop.Position), "reeds must sit on water tiles") + | VillageArt.RiverLantern -> Assert.IsTrue(plan.Grounds |> List.contains (prop.Position, VillageArt.StonePath), "lanterns must stand on the bank path") + | _ -> () [] member _.WaterRippleFramesAreDeterministicAndTwoPhase () = -- cgit v1.2.3