refactor: expose addInterruption

This commit is contained in:
2026-04-04 15:40:18 +08:00
parent 0dbb4fc2ba
commit db83e89a46
2 changed files with 10 additions and 4 deletions
@@ -15,6 +15,10 @@ export abstract class GameHostScene<TState extends Record<string, unknown>>
{
protected disposables = new DisposableBag();
protected gameHost!: GameHost<TState>;
addInterruption(promise: Promise<void>){
this.gameHost?.addInterruption(promise);
}
init(data: GameHostSceneOptions<TState>): void {
this.gameHost = data.gameHost;
@@ -29,7 +33,7 @@ export abstract class GameHostScene<TState extends Record<string, unknown>>
}
/** 获取当前状态的只读快照 */
protected get state(): TState {
public get state(): TState {
return this.gameHost.state.value;
}