feat: LazyEntityUpdater
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user