From c2e51a9f7130dd2669396fdc46fa0c473d040a35 Mon Sep 17 00:00:00 2001 From: Elia el Lazkani Date: Sat, 23 Nov 2024 19:03:05 +0100 Subject: [PATCH] chore(): Assigns cards to a room --- src/entities/room.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/entities/room.py b/src/entities/room.py index e24edb2..279804e 100644 --- a/src/entities/room.py +++ b/src/entities/room.py @@ -1,18 +1,22 @@ import uuid +from src.entities.cards import Cards + class Room: """ Room entity """ - def __init__(self, name): + def __init__(self, name, card_type="fibonacci"): """ Room entity initializer """ self.name = name self.uuid = None self.attendant = [] + self.card_type = card_type + self.cards = None self.create() def create(self): @@ -22,6 +26,8 @@ class Room: if not self.uuid: self.uuid = uuid.uuid1() + self.assign_cards() + return self def add_person(self, person: uuid.UUID): @@ -37,3 +43,14 @@ class Room: """ if person in self.attendant: 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