refactor: update api
This commit is contained in:
@@ -18,6 +18,10 @@ export abstract class GameHostScene<TState extends Record<string, unknown>>
|
||||
public get gameHost(): GameHost<TState> {
|
||||
return this._gameHost;
|
||||
}
|
||||
|
||||
public get state(): TState {
|
||||
return this.gameHost?.state.value;
|
||||
}
|
||||
|
||||
addInterruption(promise: Promise<void>){
|
||||
this.gameHost?.addInterruption(promise);
|
||||
@@ -41,11 +45,6 @@ export abstract class GameHostScene<TState extends Record<string, unknown>>
|
||||
this.disposables.dispose();
|
||||
}
|
||||
|
||||
/** 获取当前状态的只读快照 */
|
||||
public get state(): TState {
|
||||
return this.gameHost.context.value;
|
||||
}
|
||||
|
||||
public addDisposable(disposable: IDisposable){
|
||||
this.disposables.add(disposable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user