From 0fae284f79b1c934e58214cf5f88cad4cab6b03b Mon Sep 17 00:00:00 2001 From: Frans Bongers Date: Wed, 19 Mar 2025 21:55:43 +0100 Subject: refactor: FrontId to number --- rules.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'rules.ts') diff --git a/rules.ts b/rules.ts index 8299d1b..1e2ff94 100644 --- a/rules.ts +++ b/rules.ts @@ -145,7 +145,7 @@ function gen_action_card(card_id: CardId) { gen_action('card', card_id); } -function gen_action_front(front_id: string) { +function gen_action_front(front_id: FrontId) { gen_action('front', front_id); } @@ -593,28 +593,28 @@ export function setup(seed: number, _scenario: string, options: Record game.fronts[frontId].value === targetValue - ) as FrontId[]; + return game.fronts.findIndex( + (front) => front.value === targetValue + ) as unknown as FrontId[]; } // #endregion -- cgit v1.2.3