chore(): Assigns cards to a room

This commit is contained in:
Elia el Lazkani 2024-11-23 19:03:05 +01:00
parent 43f444d48f
commit c2e51a9f71

View file

@ -1,18 +1,22 @@
import uuid import uuid
from src.entities.cards import Cards
class Room: class Room:
""" """
Room entity Room entity
""" """
def __init__(self, name): def __init__(self, name, card_type="fibonacci"):
""" """
Room entity initializer Room entity initializer
""" """
self.name = name self.name = name
self.uuid = None self.uuid = None
self.attendant = [] self.attendant = []
self.card_type = card_type
self.cards = None
self.create() self.create()
def create(self): def create(self):
@ -22,6 +26,8 @@ class Room:
if not self.uuid: if not self.uuid:
self.uuid = uuid.uuid1() self.uuid = uuid.uuid1()
self.assign_cards()
return self return self
def add_person(self, person: uuid.UUID): def add_person(self, person: uuid.UUID):
@ -37,3 +43,14 @@ class Room:
""" """
if person in self.attendant: if person in self.attendant:
self.attendant.remove(person) self.attendant.remove(person)
def assign_cards(self, card_type=None):
"""
Method to assign cards to a room
"""
if card_type:
self.cards = Cards(card_type)
else:
self.cards = Cards()
return self.cards