develop-entities #2

Open
elia wants to merge 7 commits from develop-entities into main
Showing only changes of commit c2e51a9f71 - Show all commits

View file

@ -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