feat: LazyEntityUpdater

This commit is contained in:
2024-03-09 04:50:55 +00:00
parent a38f72fa46
commit fa29486af6
8 changed files with 126 additions and 42 deletions
+16 -2
View File
@@ -1,8 +1,22 @@
import type { ICityEntity } from "./CityEntity.js";
import { LazyEntityUpdater } from "./LazyEntityUpdater.js";
import type { IResourceController } from "./ResourceController.js";
import type { CityID } from "./defs.js";
export class City{
export class City extends LazyEntityUpdater<ICityEntity>{
protected readonly _indirectNames: (keyof ICityEntity)[] = ["id", "nationID"];
protected readonly _entityType = "City";
protected readonly _raw: ICityEntity;
constructor(
public readonly id: CityID
raw: ICityEntity,
protected readonly resourceController: IResourceController
){
super();
this._raw = raw;
}
get id(): CityID {
return this._raw.id;
}
}