v0.1.0: 仙途家族志 · Chronicle of the Immortal Clan
家族模拟器首版:修仙/经营/战斗/外交/叙事全套系统 - Electron + React + TS + MetonaSqlark(aria+OPFS) - 水墨中国风 UI - 引擎种子随机、确定性可回放 - 19 项单元测试、端到端冒烟验证
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user