From 23a9235f29e92adb51c3bf1a71f92cd8434e0939 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Sun, 20 Sep 2026 11:29:11 +0800 Subject: feat(m4a): 增加交易库存金钱与动态定价 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [变更性质] - 本提交新增 M4a 交易能力,不扩大到 M4b、M5 或 M6。 [新增功能] - 支持 Food 库存、买卖双方金钱转移、原子成功与拒绝结果。 - 支持基于需求、库存、性格和近期成交记忆的动态定价。 [实现方案] - 在 Sim 中增加 TradeRequest、TradeResult、交易失败类型、交易记忆与 TradeEvent。 - 以不可变 World 更新和确定性定价保持库存、金钱及事件守恒。 - 增加交易测试,并补齐既有 NPC fixture 与 MemoryKind 穷举匹配。 [影响范围] - 仅影响 LivingVillage.Kernel 交易逻辑及五个 M4a 相关测试项目文件。 --- src/LivingVillage.Kernel.Tests/DeterminismTests.fs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/LivingVillage.Kernel.Tests/DeterminismTests.fs') diff --git a/src/LivingVillage.Kernel.Tests/DeterminismTests.fs b/src/LivingVillage.Kernel.Tests/DeterminismTests.fs index 972ce19..c37be67 100644 --- a/src/LivingVillage.Kernel.Tests/DeterminismTests.fs +++ b/src/LivingVillage.Kernel.Tests/DeterminismTests.fs @@ -233,6 +233,9 @@ type DeterminismTests () = | Rest -> 0.4f | Pay -> 0.2f | Hungry -> -0.4f + | Chatted _ -> Sim.chatValence + | Bought _ -> 0.3f + | Sold _ -> 0.3f if e.Valence <> expected then Assert.Fail($"valence/kind mismatch: {e.Kind} -> {e.Valence}") if e.Valence < -1.0f || e.Valence > 1.0f then -- cgit v1.2.3