made GameProfile printable

This commit is contained in:
əlemi 2022-02-20 15:13:57 +01:00
parent 1bcb79392e
commit 46ef53496c
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E

View file

@ -1,3 +1,4 @@
import json
from math import sqrt from math import sqrt
from enum import Enum from enum import Enum
from dataclasses import dataclass from dataclasses import dataclass
@ -32,6 +33,12 @@ class GameProfile:
id : str id : str
name : str name : str
def __str__(self):
return json.dumps(self.as_dict(), indent=2)
def __repr__(self):
return f"GameProfile(id='{self.id}', name='{self.name}')"
def as_dict(self): def as_dict(self):
return { return {
"id": self.id, "id": self.id,