develop-entities #2

Open
elia wants to merge 7 commits from develop-entities into main
3 changed files with 8 additions and 24 deletions
Showing only changes of commit d3a4401d14 - Show all commits

View file

@ -11,11 +11,4 @@ class Person:
Person entity initializer
"""
self.name = name
self.uuid = None
self.create()
def create(self):
if not self.uuid:
self.uuid = uuid.uuid1()
return self
self.uuid = uuid.uuid1()

View file

@ -8,27 +8,16 @@ class Room:
Room entity
"""
def __init__(self, name, card_type="fibonacci"):
def __init__(self, name: str, creator: uuid.UUID, card_type="fibonacci"):
"""
Room entity initializer
"""
self.name = name
self.uuid = None
self.creator = creator
self.uuid = uuid.uuid1()
self.attendant = []
self.card_type = card_type
self.cards = None
self.create()
def create(self):
"""
Method to create a new room object
"""
if not self.uuid:
self.uuid = uuid.uuid1()
self.assign_cards()
return self
self.cards = self.assign_cards(card_type)
def add_person(self, person: uuid.UUID):
"""

View file

@ -11,6 +11,8 @@ def create_room(person: uuid.UUID, name: str = None):
"""
if not name:
name = random.choice(ROOM_NAMES)
r = Room(name)
r = Room(name=name, creator=person)
r.add_person(person)
return r