tournament: game: finish event

This commit is contained in:
2024-04-25 15:44:09 +02:00
parent 02bbaa6d9f
commit dbb8e07d7d
9 changed files with 135 additions and 64 deletions

View File

@ -3,6 +3,8 @@ from ..models import GameModel
from .pong.PongGame import PongGame
from .tictactoe.TicTacToeGame import TicTacToeGame
from tournament.models import TournamentGameModel
class GameManager():
def __init__(self) -> None:
@ -14,7 +16,7 @@ class GameManager():
self._game_list.remove(game)
def get(self, game_id: int, game_type: str) -> TicTacToeGame | PongGame:
if (not GameModel.objects.filter(pk=game_id, finished=False, game_type=game_type).exists()):
return None