From beea33bc183837a3feceaf1b5127c2e21e16fc36 Mon Sep 17 00:00:00 2001 From: Karan Jayachandra Date: Mon, 2 Dec 2024 19:33:48 +0100 Subject: Added team based games --- src/match_up/data.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/match_up/data.py') diff --git a/src/match_up/data.py b/src/match_up/data.py index 636a5eb..d8996fe 100644 --- a/src/match_up/data.py +++ b/src/match_up/data.py @@ -18,15 +18,18 @@ class Player(BASE): first = Column("first", String) last = Column("last", String) level = Column("level", Integer) + team = Column("team", Integer) status = Column("status", Integer) count = Column("count", Integer) + def __init__( self, id: int, first: str = "", last: str = "", level: int = 0, + team: int = 0, status: bool = True, count: int = 0, ): @@ -34,12 +37,14 @@ class Player(BASE): self.first = first self.last = last self.status = status + self.team = team self.level = level self.count = count def __repr__(self): + team = f" of Team {self.team}" if self.team else "" status = "active" if self.status else "inactive" - return f"{self.first} {self.last} (Level {self.level}) is {status} and has played {self.count} games" + return f"{self.first} {self.last} (Level {self.level}){team} is {status} and has played {self.count} games" class DisplayPlayer: -- cgit v1.3.1