game: core: recreate classes see other paddle
This commit is contained in:
@ -5,9 +5,9 @@ from ..models import GameModel
|
||||
class GameManager():
|
||||
|
||||
def __init__(self) -> None:
|
||||
self._game_list: [Game] = []
|
||||
self._game_list: list[Game] = []
|
||||
|
||||
def get(self, game_id: int):
|
||||
def get(self, game_id: int) -> Game:
|
||||
|
||||
if (not GameModel.objects.filter(pk = game_id, started = True, finished = False).exists()):
|
||||
return None
|
||||
@ -17,6 +17,10 @@ class GameManager():
|
||||
if (game.game_id == game_id):
|
||||
return game
|
||||
|
||||
return Game(game_id)
|
||||
game: Game = Game(game_id)
|
||||
|
||||
self._game_list.append(game)
|
||||
|
||||
return game
|
||||
|
||||
|
Reference in New Issue
Block a user