refac: 경로 변경

This commit is contained in:
2024-03-09 05:09:54 +00:00
parent afb6fbb1b1
commit f320ce58a2
11 changed files with 36 additions and 23 deletions
@@ -0,0 +1,7 @@
import type { CityID, CityName, NationID } from "../defs.js";
export interface ICityEntity{
id: CityID;
name: CityName;
nationID: NationID;
}
@@ -0,0 +1,65 @@
import type { DiplomaticPermission, GeneralID, GeneralName, ItemID, ItemKeyType, NationID, NpcType, OfficerLevel, OwnerID, OwnerName, PersonalityType, SpecialityDomesticType, SpecialityWarType, TroopID } from "../defs.js";
export interface IGeneralEntity {
id: GeneralID;
owner?: OwnerID;
npcType: NpcType;
affinity?: number;
picture?: string;
name: GeneralName;
ownerName?: OwnerName;
nationID: NationID;
cityID: number;
troopID?: TroopID;
leadership: number;
leadershipExp: number;
strength: number;
strengthExp: number;
intel: number;
intelExp: number;
injury: number;
experience: number;
dedication: number;
experienceLevel: number;
dedicationLevel: number;
dex: number[];
officerLevel: OfficerLevel;
diplomaticPermission: DiplomaticPermission;
gold: number;
rice: number;
item: Record<ItemKeyType, {
id: ItemID,
option: Record<string, unknown>,
}>;
turntime: Date;
killturn: number;
age: number;
startAge: number;
nationBelong: number;
betray: number;
personality: PersonalityType;
specialityDomestic: SpecialityDomesticType;
specialityWar: SpecialityWarType;
defenceTrain: number;
npcSpec?: {
msg?: string;
bornyear: number;
deadyear: number;
}
}
@@ -0,0 +1,9 @@
import type { CityID, NationID, NationName, NationType } from "../defs.js";
export interface INationEntity{
id: NationID;
name: NationName;
type: NationType;
capitalID: CityID;
}
@@ -0,0 +1,7 @@
import type { NationID, TroopID } from "../defs.js";
export interface ITroopEntity {
id: TroopID;
nationID: NationID;
name: string;
}
+21
View File
@@ -0,0 +1,21 @@
import type { ValuesOf } from '@sammo/util';
import type { ICityEntity } from './CityEntity.js';
import type { IGeneralEntity } from './GeneralEntity.js';
import type { INationEntity } from './NationEntity.js';
import type { ITroopEntity } from './TroopEntity.js';
export type { IGeneralEntity } from './GeneralEntity.js';
export type { ICityEntity } from './CityEntity.js';
export type { ITroopEntity } from './TroopEntity.js';
export type { INationEntity } from './NationEntity.js';
export type ValidEntityList = {
'General': IGeneralEntity;
'City': ICityEntity;
'Nation': INationEntity;
'Troop': ITroopEntity;
};
export type ValidEntity = ValuesOf<ValidEntityList>;
export type ValidEntityType<Entity> = Entity extends ValidEntityList[infer T extends keyof ValidEntityList] ? T : never;