from util.room.data import Room class RoomRegistry: def __init__(self): self.rooms: dict[str, Room] = {} def create_room(self, code: str, password: str = None) -> Room: room = Room(code=code, password=password) self.rooms[code] = room return room def get_room(self, code: str) -> Room: return self.rooms.get(code) def delete_room(self, code: str): if code in self.rooms: del self.rooms[code]