fix: 감찰부 도시 관직명 누락

This commit is contained in:
2022-07-24 17:15:06 +09:00
parent e578a2f310
commit 7b3d64996d
2 changed files with 20 additions and 2 deletions
+14
View File
@@ -0,0 +1,14 @@
import type { GameConstStore } from "@/GameConstStore";
interface WithCityID {
city: number;
}
export function formatCityName(target: number | WithCityID, gameConst: GameConstStore): string {
const cityID = typeof target === "number" ? target : target.city;
const city = gameConst.cityConst[cityID];
if (city === undefined) {
throw `City ${cityID} not found`;
}
return city.name;
}