refactor: 将 system-action 与 system-ui 合并至 system

This commit is contained in:
AncTe committed 2026-03-08 17:01:05 +08:00
1 parent 744a21e042
commit 03cf6a8917
64 files changed
+82 -174

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { IGameUI, UIComponent } from './shared';
export class GameUI<C extends UIComponent> implements IGameUI<C> {
static list: Map<string, GameUI<UIComponent>> = new Map();
constructor(
public readonly name: string,
public readonly component: C
) {}
/**
* 根据 ui 名称获取 ui 实例
* @param id ui 的名称
*/
static get<T extends UIComponent>(id: string): GameUI<T> | null {
const ui = this.list.get(id) as GameUI<T>;
return ui ?? null;
}
}