from transcendence.abstract.AbstractRoomManager import AbstractRoomManager from ..models import GameModel class GameRoomManager(AbstractRoomManager): def get(self, game_id: int): for room in self._room_list: if (room.game_id == game_id): return room if (GameModel.objects.filter(pk = tournament_id).exists()): room = TournamentRoom(self, game_id) self.append(room) return room return None