ft_transcendence/transcendence/abstract/AbstractRoomManager.py

18 lines
440 B
Python
Raw Normal View History

2023-12-23 12:11:30 -05:00
from .AbstractRoom import AbstractRoom
class AbstractRoomManager:
def __init__(self):
self._room_list: [AbstractRoom] = []
def get(self, mode: int):
for room in self._room_list:
room: A
if (waiting_room._mode == mode):
return waiting_room
tmp: WaitingRoom = WaitingRoom(self, mode)
self._waiting_rooms.append(tmp)
return tmp
def remove(self, waiting_room: WaitingRoom):
self._waiting_rooms.remove(waiting_room)