chore(): Cleaning up a bit of unneeded code

This commit is contained in:
Elia el Lazkani 2024-11-24 21:35:45 +01:00
parent 9a1f1c8b67
commit d3a4401d14
3 changed files with 8 additions and 24 deletions

View file

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

View file

@ -8,27 +8,16 @@ class Room:
Room entity Room entity
""" """
def __init__(self, name, card_type="fibonacci"): def __init__(self, name: str, creator: uuid.UUID, card_type="fibonacci"):
""" """
Room entity initializer Room entity initializer
""" """
self.name = name self.name = name
self.uuid = None self.creator = creator
self.uuid = uuid.uuid1()
self.attendant = [] self.attendant = []
self.card_type = card_type self.card_type = card_type
self.cards = None self.cards = self.assign_cards(card_type)
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
def add_person(self, person: uuid.UUID): 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: if not name:
name = random.choice(ROOM_NAMES) name = random.choice(ROOM_NAMES)
r = Room(name)
r = Room(name=name, creator=person)
r.add_person(person) r.add_person(person)
return r return r