mirror of
https://github.com/motajs/template.git
synced 2026-10-17 03:10:17 +08:00
feat: CoreState 配置添加 loadStarter
This commit is contained in:
parent
f5a6ed8cf6
commit
ed0b95b1c4
@ -42,6 +42,7 @@ import {
|
||||
} from './shared';
|
||||
import { loading } from '@user/data-base';
|
||||
import { fallbackLoad } from './fallback/load';
|
||||
import { WebLoadStarter } from '@motajs/loader';
|
||||
|
||||
export class ClientCore extends CoreState implements IClientCore {
|
||||
// Layer 4 渲染基础层
|
||||
@ -63,7 +64,9 @@ export class ClientCore extends CoreState implements IClientCore {
|
||||
readonly bgmPlayer: IBGMPlayer<BgmIds>;
|
||||
|
||||
constructor() {
|
||||
super({});
|
||||
super({
|
||||
loadStarter: new WebLoadStarter()
|
||||
});
|
||||
|
||||
//#region Layer 4
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { WebLoadStarter } from '@motajs/loader';
|
||||
import { CoreState } from './core';
|
||||
|
||||
// TODO: 逐渐弱化 CoreState 的单例概念,每个接口都通过参数传入 ICoreState 对象
|
||||
@ -7,4 +8,6 @@ import { CoreState } from './core';
|
||||
* 此对象是数据端状态,本身不负责任何渲染操作,仅会向渲染端发送数据让渲染端渲染,不要把渲染操作直接放到此对象上,
|
||||
* 否则可能导致录像验证失败。
|
||||
*/
|
||||
export const state = new CoreState({});
|
||||
export const state = new CoreState({
|
||||
loadStarter: new WebLoadStarter()
|
||||
});
|
||||
|
||||
@ -1,9 +1,15 @@
|
||||
import { IMotaDataLoader, IStateBase } from '@user/data-base';
|
||||
import { ILoadManager } from '@motajs/loader';
|
||||
import { ILoadManager, ILoadTaskStarter } from '@motajs/loader';
|
||||
import { IStateSystem } from '@user/data-system';
|
||||
import { ISaveableContent } from '@user/data-common';
|
||||
|
||||
export interface ICoreStateConfig {}
|
||||
export interface ICoreStateConfig {
|
||||
/**
|
||||
* 加载启动器,用于适配不同加载环境。
|
||||
* 例如网页端会使用 Web 加载器,而 node 端会使用专门的 node 加载器
|
||||
*/
|
||||
readonly loadStarter: ILoadTaskStarter;
|
||||
}
|
||||
|
||||
export interface ISaveableExecutor<T> {
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user