diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-03-20 01:30:04 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-03-20 01:30:04 +0100 |
commit | 8a16b5eb275a96d9e0dfa8d37a04969b49e319f2 (patch) | |
tree | c1f56a60d494d46aadc10f1f71ce0268de154df4 | |
parent | ad43e7881da6202aecf68b22ea5a7db469df1b8e (diff) | |
download | land-and-freedom-8a16b5eb275a96d9e0dfa8d37a04969b49e319f2.tar.gz |
Fix iterators of hero_points and fronts.
-rw-r--r-- | rules.js | 8 | ||||
-rw-r--r-- | rules.ts | 9 |
2 files changed, 8 insertions, 9 deletions
@@ -2167,8 +2167,8 @@ function determine_winner() { resolve_active_and_proceed(); } function end_of_turn() { - Object.keys(game.fronts).forEach((front_id) => { - game.fronts[front_id].contributions = []; + game.fronts.forEach(front => { + front.contributions = []; }); game.active_abilities = []; game.used_medallions = []; @@ -2902,8 +2902,8 @@ function get_source_name(source) { function get_factions_with_most_hero_poins() { let most_hero_points = null; let faction_ids = []; - Object.entries(game.hero_points).forEach(([id, value]) => { - if (id === 'pool') { + game.hero_points.forEach((value, id) => { + if (id === POOL_ID) { return; } if (most_hero_points === null || value > most_hero_points) { @@ -7,7 +7,6 @@ import { EngineNode, EventCard, FactionId, - Front, FrontId, FunctionNode, Game, @@ -2673,8 +2672,8 @@ function determine_winner() { } function end_of_turn() { - Object.keys(game.fronts).forEach((front_id) => { - game.fronts[front_id].contributions = []; + game.fronts.forEach(front => { + front.contributions = []; }); game.active_abilities = []; game.used_medallions = []; @@ -3645,8 +3644,8 @@ function get_source_name(source: EffectSource): string { function get_factions_with_most_hero_poins(): FactionId[] { let most_hero_points = null; let faction_ids = []; - Object.entries(game.hero_points).forEach(([id, value]) => { - if (id === 'pool') { + game.hero_points.forEach((value, id) => { + if (id === POOL_ID) { return; } if (most_hero_points === null || value > most_hero_points) { |