Feat: add __repr__ and to_dict
This commit is contained in:
parent
b4df4d6c09
commit
309e9627e7
@ -25,3 +25,9 @@ class Tribe:
|
|||||||
if isinstance(other, Tribe):
|
if isinstance(other, Tribe):
|
||||||
return self.name == other.name
|
return self.name == other.name
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
return f"<Tribe {self.name=}>"
|
||||||
|
|
||||||
|
def to_dict(self) -> dict:
|
||||||
|
return {"name": self.name, "level": self.level}
|
||||||
|
Loading…
Reference in New Issue
Block a user