Files
ChronicleOfTheImmortalClan/tests/world.helpers.ts
T
thzxx ff6df8054c refactor(0.1.14-P1): 内核归位——game/ 按引擎架构重排(零行为漂移)
结构(旧 game/core+engine → 新 engine/ 域):
- engine/kernel/  时钟/随机/插件协议/fxqueue/timesense/format/urgency/guide/names(原 core)
- engine/narrative/  legacy/报告/列传/谱系/年轴(原 core 叙事族)
- engine/runtime/   World/creation/pcgen/ApiFacade/capabilities/pluginManager/boot/clocks + Systems/*(12 系统)
- engine/sim/     Market(未来 WorldSim 同行)
- 旧 game/core、engine/systems、engine/world.ts 等路径全部废弃(无 re-export 兼容层)

验证:35 套件/967 测试全绿(金钟罩三档零漂移=纯搬迁无行为变化)
typecheck 0 error
2026-08-23 13:23:25 +08:00

22 lines
569 B
TypeScript

import { World, WorldEventBus } from '../src/renderer/game/engine/runtime/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)
}