refactor: addInterrupt is now on GameHost
This commit is contained in:
@@ -79,6 +79,22 @@ export class GameHost<TState extends Record<string, unknown>> {
|
||||
return this.commands._tryCommit(input);
|
||||
}
|
||||
|
||||
/**
|
||||
* 为下一个 produceAsync 注册中断 Promise(通常用于 UI 动画)。
|
||||
* @see MutableSignal.addInterruption
|
||||
*/
|
||||
addInterruption(promise: Promise<void>): void {
|
||||
this._state.addInterruption(promise);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除所有未完成的中断。
|
||||
* @see MutableSignal.clearInterruptions
|
||||
*/
|
||||
clearInterruptions(): void {
|
||||
this._state.clearInterruptions();
|
||||
}
|
||||
|
||||
async setup(setupCommand: string): Promise<void> {
|
||||
if (this._isDisposed) {
|
||||
throw new Error('GameHost is disposed');
|
||||
|
||||
Reference in New Issue
Block a user