From 96c6fc0df2465a26f0355768e16044540fa0076a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sun, 14 Jan 2024 13:11:02 +0100 Subject: [PATCH] improve endgame table output --- deps/py-hanabi | 2 +- src/render_site.py | 8 +++++++- templates/game.html | 16 +++++++++++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/deps/py-hanabi b/deps/py-hanabi index 3ac51d5..51e09cd 160000 --- a/deps/py-hanabi +++ b/deps/py-hanabi @@ -1 +1 @@ -Subproject commit 3ac51d574e65aff9b3420fdebd467d7b98ea1d28 +Subproject commit 51e09cd94393de64e07191d6ca544139417acb3b diff --git a/src/render_site.py b/src/render_site.py index 1361108..ee57017 100644 --- a/src/render_site.py +++ b/src/render_site.py @@ -754,7 +754,13 @@ class EndgameActionRow: def convert_endgame_action(endgame_action: endgames.EndgameAction) -> EndgameActionRow: - description = "{} {}".format(endgames.print_action_type(endgame_action.action_type), endgame_action.card) + action_str = endgames.print_action_type(endgame_action.action_type) + target_str: str + if action_str != "Clue": + target_str = " {}".format(endgame_action.card) + else: + target_str = "" + description = action_str + target_str return EndgameActionRow(description, endgame_action.enumerator, endgame_action.denominator) diff --git a/templates/game.html b/templates/game.html index cdd6754..e92a3d3 100644 --- a/templates/game.html +++ b/templates/game.html @@ -23,9 +23,19 @@

- Endgame Statistics for game {{game_id}} + Statistics for game {{game_id}}

- Replay Link + +

+ Endgame Analysis table +

@@ -35,7 +45,7 @@ {% for (turn, best_action, other_actions) in data %} - +
Turn
{{ turn }}{{ turn }} {{ best_action.description }} {{ best_action.enumerator }}/{{ best_action.denominator }} {{ best_action.win_rate }}%