compress.py: add method for colored output

This commit is contained in:
Maximilian Keßler 2023-03-17 11:55:07 +01:00
parent c381a4c129
commit 0851f83e12
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -38,6 +38,9 @@ class DeckCard():
# should be injective enough, we never use cards with ranks differing by 1000
return 1000 * self.suitIndex + self.rank
def colorize(self):
color = ["green", "blue", "magenta", "yellow", "white", "cyan"][self.suitIndex]
return colored(str(self), color)
class ActionType(Enum):
Play = 0