From a72cfc8e1cd12181aea68237a4c9a15263e686b3 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Fri, 26 Aug 2022 13:02:49 +0900 Subject: [PATCH] =?UTF-8?q?misc:=20calcTournamentTerm=20ts=20=EC=9D=B4?= =?UTF-8?q?=EC=8B=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/utilGame/index.ts | 3 ++- hwe/ts/utilGame/tournament.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 hwe/ts/utilGame/tournament.ts diff --git a/hwe/ts/utilGame/index.ts b/hwe/ts/utilGame/index.ts index d3b26892..cf9046a0 100644 --- a/hwe/ts/utilGame/index.ts +++ b/hwe/ts/utilGame/index.ts @@ -13,4 +13,5 @@ export { getNPCColor } from "./getNPCColor"; export { isValidObjKey } from "./isValidObjKey"; export { nextExpLevelRemain } from "./nextExpLevelRemain"; export { postFilterNationCommandGen } from "./postFilterNationCommandGen"; -export { isTechLimited, convTechLevel, getMaxRelativeTechLevel } from "./techLevel"; \ No newline at end of file +export { isTechLimited, convTechLevel, getMaxRelativeTechLevel } from "./techLevel"; +export { calcTournamentTerm } from "./tournament"; \ No newline at end of file diff --git a/hwe/ts/utilGame/tournament.ts b/hwe/ts/utilGame/tournament.ts new file mode 100644 index 00000000..3b740100 --- /dev/null +++ b/hwe/ts/utilGame/tournament.ts @@ -0,0 +1,4 @@ +import { clamp } from 'lodash-es'; +export function calcTournamentTerm(turnTerm: number): number{ + return clamp(turnTerm, 5, 120); +} \ No newline at end of file