IResourceController
This commit is contained in:
+4
-2
@@ -19,6 +19,8 @@ export interface IResourceController {
|
||||
troop(id: TroopID, nation: NationID): Troop | undefined;
|
||||
general(id: GeneralID): General | undefined;
|
||||
|
||||
upcomingGeneral(): General | undefined;
|
||||
|
||||
gameEnv(): GameEnv;
|
||||
|
||||
allNations(): Map<NationID, Nation>;
|
||||
@@ -65,8 +67,8 @@ export interface IResourceController {
|
||||
|
||||
let _resourceController: IResourceController | undefined = undefined;
|
||||
|
||||
export const setResourceController = (resourceController: IResourceController) => {
|
||||
_resourceController = resourceController;
|
||||
export const setResourceController = (rsc: IResourceController) => {
|
||||
_resourceController = rsc;
|
||||
}
|
||||
|
||||
export const getResourceController = () => {
|
||||
@@ -1,5 +1,6 @@
|
||||
export * from "./LogicFunc/generalStats.js";
|
||||
export * as defs from "./defs.js";
|
||||
export * from "./IResourceController.js";
|
||||
|
||||
// NOTE: game_logic은 client, server 모두에서 사용되는 라이브러리이다.
|
||||
// DB에 접근한다면 DI여야하나?
|
||||
@@ -0,0 +1,134 @@
|
||||
import type { IResourceController } from "@sammo/game_logic";
|
||||
import type { City } from "@sammo/game_logic/src/City.js";
|
||||
import type { CityID, GeneralID, NationID, TroopID } from "@sammo/game_logic/src/defs.js";
|
||||
import type { IGeneralEntity } from "@sammo/game_logic/src/Entity/GeneralEntity.js";
|
||||
import type { ValidEntityType } from "@sammo/game_logic/src/Entity/index.js";
|
||||
import type { INationEntity } from "@sammo/game_logic/src/Entity/NationEntity.js";
|
||||
import type { IReservedTurn } from "@sammo/game_logic/src/Entity/ReservedTurn.js";
|
||||
import type { ITroopEntity } from "@sammo/game_logic/src/Entity/TroopEntity.js";
|
||||
import type { GameEnv } from "@sammo/game_logic/src/GameEnv.js";
|
||||
import type { General } from "@sammo/game_logic/src/General.js";
|
||||
import type { LazyEntityUpdater } from "@sammo/game_logic/src/LazyEntityUpdater.js";
|
||||
import type { Nation } from "@sammo/game_logic/src/Nation.js";
|
||||
import type { Troop } from "@sammo/game_logic/src/Troop.js";
|
||||
import { NotYetImplemented } from "@sammo/util";
|
||||
|
||||
//TODO: Implement!
|
||||
export class ResourceController implements IResourceController{
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
nation(id: NationID): Nation | undefined {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
city(id: CityID): City | undefined {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
troop(id: TroopID, nation: NationID): Troop | undefined {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
general(id: GeneralID): General | undefined {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
upcomingGeneral(): General | undefined {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
gameEnv(): GameEnv {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
allNations(): Map<NationID, Nation> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
allCities(): Map<CityID, City> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
allCitiesByNation(): Map<NationID, Map<CityID, City>> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
allTroops(): Map<NationID, Map<TroopID, Troop>> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
allGenerals(): Map<GeneralID, General> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
generalByNation(id: NationID): Map<GeneralID, General> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
generalByCity(id: CityID, nationID?: NationID): Map<GeneralID, General> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
generalByTroop(id: TroopID): Map<GeneralID, General> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
cityByNation(id: NationID): Map<CityID, City> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
troopByNation(id: NationID): Map<TroopID, Troop> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
|
||||
//----Insert, Update, Delete
|
||||
|
||||
reserveUpdate(entity: LazyEntityUpdater<any>): void {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
reserveDelete(entity: LazyEntityUpdater<any>): void {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
reserveInsert(entity: LazyEntityUpdater<any>): void {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
createGeneral(raw: IGeneralEntity): General {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
createNation(raw: INationEntity): Nation {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
createTroop(raw: ITroopEntity): Troop {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
_getAllChanges(): Record<ValidEntityType, Map<number, [op: "insert" | "update" | "delete", value: LazyEntityUpdater<any>]>> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
//---- DB 접근 ---
|
||||
|
||||
getReservedTurn(general: General): Promise<IReservedTurn> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
nationReservedTurn(general: General): Promise<IReservedTurn | undefined> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
resetAndFill(): Promise<void> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
|
||||
saveAll(): Promise<void> {
|
||||
throw new NotYetImplemented();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user