feat(0.1.14-P4/P5): UI 单点 + 引擎级测试(979)+ 顶栏天下风云

- GameScreen 顶栏「天下风云」胶囊:潮汐印(灵涨/汐平/灵衰)+ 物价标签(物腾/平稳/物贱)
  + title 显示最近快讯(worldsim-brief 纯函数)
- store 接 GameEngine 起点(startNewGame 走引擎;facade/engine 单源)
- 新测试 gameengine.test.ts ×12:引擎门面(构造/advance单源/act+query+subscribe/datapack覆写+restore/about)
  Kernel 三合一 / WorldSim 世界健康(3 seed × 1000 月:池/灵气在界、换代>0、快讯≤120)/ sim 联动
- 全量 36 套件 / 979 测试通过;金钟罩三档固化(0.1.14 正式);typecheck 0 error
- AGENTS 补「引擎系统」章节;版本 0.1.14
This commit is contained in:
2026-08-23 13:33:39 +08:00
parent 5dd5d6b558
commit 26bd61fba0
7 changed files with 272 additions and 4 deletions
@@ -0,0 +1,13 @@
import { World } from '../runtime/World'
export function worldSimBrief(w: World): { tideLabel: string; priceLabel: string; latest: string } | null {
const ws = w.state.worldSim
if (!ws) return null
const tide = ws.tide ?? 0.5
const tideLabel = tide > 0.9 ? '灵涨' : tide < 0.7 ? '灵衰' : '汐平'
const pool = ws.marketPool ?? {}
const ratio = (pool['lingcao'] ?? 600) / 600
const priceLabel = ratio > 1.15 ? '物腾' : ratio < 0.85 ? '物贱' : '平稳'
const latest = ws.newsFeed?.[ws.newsFeed.length - 1]?.text ?? ''
return { tideLabel, priceLabel, latest }
}