feat: LazyEntityUpdater
This commit is contained in:
@@ -6,6 +6,19 @@ import type { GameEnv } from "./GameEnv.js";
|
||||
import type { IGeneralEntity } from "./GeneralEntity.js";
|
||||
import type { Troop } from "./Troop.js";
|
||||
import type { ITroopEntity } from "./TroopEntity.js";
|
||||
import type { LazyEntityUpdater } from "./LazyEntityUpdater.js";
|
||||
import type { ICityEntity } from "./CityEntity.js";
|
||||
import type { INationEntity } from "./NationEntity.js";
|
||||
|
||||
export type ValidEntityList = {
|
||||
'General': IGeneralEntity;
|
||||
'City': ICityEntity;
|
||||
'Nation': INationEntity;
|
||||
'Troop': ITroopEntity;
|
||||
};
|
||||
|
||||
export type ValidEntity = ValidEntityList[keyof ValidEntityList];
|
||||
export type ValidEntityType<Entity> = Entity extends ValidEntityList[infer T extends keyof ValidEntityList] ? T : never;
|
||||
|
||||
export interface IResourceController{
|
||||
addCity(city: City): boolean;
|
||||
@@ -38,6 +51,8 @@ export interface IResourceController{
|
||||
setDirtyTroop(troop: Troop | TroopID): void;
|
||||
setDirtyNation(nation: Nation): void;
|
||||
|
||||
setDirty(entity: LazyEntityUpdater<any>): void;
|
||||
|
||||
createGeneral(raw: IGeneralEntity): General;
|
||||
createTroop(raw: ITroopEntity): Troop;
|
||||
//createNation
|
||||
|
||||
Reference in New Issue
Block a user