CityEntity

This commit is contained in:
2024-03-11 12:20:50 +00:00
parent f693406df6
commit e236654ecf
2 changed files with 127 additions and 1 deletions
+69 -1
View File
@@ -1,7 +1,75 @@
import type { CityID, CityName, NationID } from "../defs.js"; import type { CityID, CityLevel, CityName, CityOfficerLevel, CityState, FrontStatus, NationID, RegionID } from "../defs.js";
export interface ICityEntity{ export interface ICityEntity{
id: CityID; id: CityID;
name: CityName; name: CityName;
nationID: NationID; nationID: NationID;
level: CityLevel;
//보급품 있음
hasSupply: boolean;
//도시 접경 상태
frontStatus: FrontStatus;
//인구
population: {
current: number;
max: number;
}
//농업
agriculture: {
current: number;
max: number;
}
//상업
commerce: {
current: number;
max: number;
}
//치안
security: {
current: number;
max: number;
}
//민도
loyalty: {
current: number;
max: 100;
}
//수비병
defence: {
current: number;
max: number;
}
//성벽
wall: {
current: number;
max: number;
}
//전투 사망자 수(혹은 패잔병)
battleDeath: number;
//상인 존재 및 거래율, base 1
trader?: number;
officerSet: Record<CityOfficerLevel, boolean>;
regionID: RegionID;
state: CityState;
//전투 잔여 개월
remainWarMonth: number;
//국가별 수비병 사살 수
conflict: Record<NationID, number>;
} }
+58
View File
@@ -14,6 +14,9 @@ export type TroopName = string & { zz_t?: "TroopName" };
export type NationID = number & { zz_t?: "NationID" }; export type NationID = number & { zz_t?: "NationID" };
export type NationName = string & { zz_t?: "NationName" }; export type NationName = string & { zz_t?: "NationName" };
//지역 ID
export type RegionID = number & { zz_t?: "RegionID" };
//TODO: 무언가의 keyof 로 바꿔야함 //TODO: 무언가의 keyof 로 바꿔야함
export type NationType = string & { zz_t?: "NationType" }; export type NationType = string & { zz_t?: "NationType" };
export type StrategicTurnType = string & { zz_t?: "StrategicTurnType" }; export type StrategicTurnType = string & { zz_t?: "StrategicTurnType" };
@@ -74,6 +77,61 @@ export const enum DiplomaticPermission {
} }
export const enum CityLevel {
= 1,
= 2,
= 3,
= 4,
= 5,
= 6,
= 7,
= 8,
}
export const enum FrontStatus {
//출병가능한 도시 없음. 중립.
Neutral = 0,
//전쟁 중인 국가가 인접함
NearWar = 1,
//선포 중인 국가가 인접함
NearDeclare = 2,
//공백지 있음
NearEmpty = 3,
}
export const enum CityOfficerLevel {
cityLeadership = 2,
cityIntel = 3,
cityStrength = 4,
}
//XXX: 기존처럼 값 하나만 유지할 것인가?
export const enum CityState {
//일반
normal = 0,
//풍년
goodHarvest = 1,
//호황
commercialBoom = 2,
//혹한
coldWave = 3,
//역병
plague = 4,
//지진
earthquake = 5,
//태풍
typhoon = 6,
//홍수
flood = 7,
//메뚜기 떼
locust = 8,
//도적
thief = 9,
}
/* 전용 stat이어서 확장하고자 하는경우 아래와 같이 확장 가능 /* 전용 stat이어서 확장하고자 하는경우 아래와 같이 확장 가능
```ts ```ts
declare module "@/defs.js" { declare module "@/defs.js" {