Files
ChronicleOfTheImmortalClan/tests/world.helpers.ts
T
thzxx adb22f0558 v0.1.0: 仙途家族志 · Chronicle of the Immortal Clan
家族模拟器首版:修仙/经营/战斗/外交/叙事全套系统
- Electron + React + TS + MetonaSqlark(aria+OPFS)
- 水墨中国风 UI
- 引擎种子随机、确定性可回放
- 19 项单元测试、端到端冒烟验证
2026-08-23 00:04:16 +08:00

22 lines
561 B
TypeScript

import { World, WorldEventBus } from '../src/renderer/game/engine/world'
import { LogItem, ChronicleEntry, BattleLog } from '../src/renderer/game/types/domain'
const sinks: Set<WorldEventBus> = new Set()
resetSaveBus()
export function resetSaveBus(): void {
sinks.clear()
}
export function attachLogSink(w: World): void {
const bus: WorldEventBus = {
onLog: () => undefined,
onChronicle: () => undefined,
onBattle: () => undefined,
onPendingEvent: () => undefined,
onGameOver: () => undefined
}
sinks.add(bus)
w.out.push(bus)
}