From 0051ccb9050cedd5935ad3c29236f1586ccf9952 Mon Sep 17 00:00:00 2001 From: Trevor Bayless <3620552+trevorbayless@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:42:37 -0600 Subject: [PATCH] Fix offline_game_model update ordering #33 The base model update method was being called before we report the game has ended. This caused a delay in reporting of the game over status. --- src/cli_chess/core/game/offline_game/offline_game_model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli_chess/core/game/offline_game/offline_game_model.py b/src/cli_chess/core/game/offline_game/offline_game_model.py index 01391bc..a4360e1 100644 --- a/src/cli_chess/core/game/offline_game/offline_game_model.py +++ b/src/cli_chess/core/game/offline_game/offline_game_model.py @@ -21,10 +21,11 @@ def update(self, *args, **kwargs) -> None: listens to subscribed model update events and if deemed necessary triages and notifies listeners of the event. """ - super().update(*args, **kwargs) if EventTopics.GAME_END in args: self._report_game_over() + super().update(*args, **kwargs) + def make_move(self, move: str): """Sends the move to the board model for it to be made""" if self.game_in_progress: