wip: 개체 작업 진행
This commit is contained in:
@@ -1,34 +1,53 @@
|
||||
import type { General } from "./General.js";
|
||||
import type { City } from "./City.js";
|
||||
import type { Nation } from "./Nation.js";
|
||||
import type { CityID, GeneralID, NationID } from "./defs.js";
|
||||
import type { CityID, GeneralID, NationID, TroopID } from "./defs.js";
|
||||
import type { GameEnv } from "./GameEnv.js";
|
||||
import type { IGeneralEntity } from "./GeneralEntity.js";
|
||||
import type { Troop } from "./Troop.js";
|
||||
import type { ITroopEntity } from "./TroopEntity.js";
|
||||
|
||||
export interface IResourceController{
|
||||
addCity(city: City): Promise<boolean>;
|
||||
addNation(nation: Nation): Promise<boolean>;
|
||||
addGeneral(general: General): Promise<boolean>;
|
||||
addCity(city: City): boolean;
|
||||
addNation(nation: Nation): boolean;
|
||||
addGeneral(general: General): boolean;
|
||||
|
||||
getCity(id: CityID, allowFromDB?: boolean): Promise<City | undefined>;
|
||||
getNation(id: NationID, allowFromDB?: boolean): Promise<Nation | undefined>;
|
||||
getGeneral(id: GeneralID, allowFromDB?: boolean): Promise<General | undefined>;
|
||||
getCity(id: CityID): City | undefined;
|
||||
getNation(id: NationID): Nation | undefined;
|
||||
getGeneral(id: GeneralID): General | undefined;
|
||||
|
||||
getGameEnv(): Promise<GameEnv>;
|
||||
|
||||
findAllNations(): Promise<Map<NationID, Nation>>;
|
||||
findAllCities(): Promise<Map<CityID, City>>;
|
||||
findAllGenerals(): Promise<Map<GeneralID, General>>;
|
||||
findAllNations(): Map<NationID, Nation>;
|
||||
findAllCities(): Map<CityID, City>;
|
||||
findAllGenerals(): Map<GeneralID, General>;
|
||||
|
||||
findCityByNation(id: NationID): Promise<Map<CityID, City>>;
|
||||
findGeneralByNation(id: NationID): Promise<Map<GeneralID, General>>;
|
||||
findGeneralByCity(id: CityID, nationID?: NationID): Promise<Map<GeneralID, General>>;
|
||||
findGeneralByTroop(id: TroopID): Map<GeneralID, General>;
|
||||
|
||||
findGeneralByQuery(query: unknown): Promise<Map<GeneralID, General>>;
|
||||
findCityByQuery(query: unknown): Promise<Map<CityID, City>>;
|
||||
findNationByQuery(query: unknown): Promise<Map<NationID, Nation>>;
|
||||
findCityByNation(id: NationID): Map<CityID, City>;
|
||||
findGeneralByNation(id: NationID): Map<GeneralID, General>;
|
||||
findGeneralByCity(id: CityID, nationID?: NationID): Map<GeneralID, General>;
|
||||
|
||||
reset(): void;
|
||||
save(): Promise<void>;
|
||||
getTroop(id: TroopID, nation: NationID): Troop | undefined;
|
||||
|
||||
_getAllChanges(): Map<unknown, unknown>;
|
||||
|
||||
|
||||
setDirtyGeneral(rawGeneral: IGeneralEntity): void;
|
||||
setDirtyCity(city: City): void;
|
||||
setDirtyTroop(troop: Troop | TroopID): void;
|
||||
setDirtyNation(nation: Nation): void;
|
||||
|
||||
createGeneral(raw: IGeneralEntity): General;
|
||||
createTroop(raw: ITroopEntity): Troop;
|
||||
//createNation
|
||||
|
||||
reserveDeleteTroop(id: TroopID): void;
|
||||
reserveDeleteGeneral(id: GeneralID): void;
|
||||
reserveDeleteNation(id: NationID): void;
|
||||
|
||||
resetAndFill(): Promise<void>;
|
||||
saveAll(): Promise<void>;
|
||||
}
|
||||
|
||||
let _resourceController: IResourceController | undefined = undefined;
|
||||
|
||||
Reference in New Issue
Block a user