CityEntity
This commit is contained in:
@@ -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{
|
||||
id: CityID;
|
||||
name: CityName;
|
||||
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>;
|
||||
}
|
||||
@@ -14,6 +14,9 @@ export type TroopName = string & { zz_t?: "TroopName" };
|
||||
export type NationID = number & { zz_t?: "NationID" };
|
||||
export type NationName = string & { zz_t?: "NationName" };
|
||||
|
||||
//지역 ID
|
||||
export type RegionID = number & { zz_t?: "RegionID" };
|
||||
|
||||
//TODO: 무언가의 keyof 로 바꿔야함
|
||||
export type NationType = string & { zz_t?: "NationType" };
|
||||
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이어서 확장하고자 하는경우 아래와 같이 확장 가능
|
||||
```ts
|
||||
declare module "@/defs.js" {
|
||||
|
||||
Reference in New Issue
Block a user