forked from test/mau_mau_bot
special card representation improved
This commit is contained in:
parent
3b590d9fca
commit
ab615f354c
1 changed files with 7 additions and 4 deletions
11
card.py
11
card.py
|
@ -5,14 +5,16 @@ RED = 'r'
|
||||||
BLUE = 'b'
|
BLUE = 'b'
|
||||||
GREEN = 'g'
|
GREEN = 'g'
|
||||||
YELLOW = 'y'
|
YELLOW = 'y'
|
||||||
|
BLACK = 'x'
|
||||||
|
|
||||||
COLORS = (RED, BLUE, GREEN, YELLOW)
|
COLORS = (RED, BLUE, GREEN, YELLOW, BLACK)
|
||||||
|
|
||||||
COLOR_ICONS = {
|
COLOR_ICONS = {
|
||||||
RED: Emoji.HEAVY_BLACK_HEART,
|
RED: Emoji.HEAVY_BLACK_HEART,
|
||||||
BLUE: Emoji.BLUE_HEART,
|
BLUE: Emoji.BLUE_HEART,
|
||||||
GREEN: Emoji.GREEN_HEART,
|
GREEN: Emoji.GREEN_HEART,
|
||||||
YELLOW: Emoji.YELLOW_HEART,
|
YELLOW: Emoji.YELLOW_HEART,
|
||||||
|
BLACK: '⬛️'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Values
|
# Values
|
||||||
|
@ -176,9 +178,10 @@ class Card(object):
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
if self.special:
|
if self.special:
|
||||||
return '%s%s' % (Emoji.BROKEN_HEART,
|
return '%s%s%s' % (COLOR_ICONS.get(self.color, ''),
|
||||||
' '.join([s.capitalize()
|
COLOR_ICONS[BLACK],
|
||||||
for s in self.special.split('_')]))
|
' '.join([s.capitalize()
|
||||||
|
for s in self.special.split('_')]))
|
||||||
else:
|
else:
|
||||||
return '%s%s' % (COLOR_ICONS[self.color], self.value.capitalize())
|
return '%s%s' % (COLOR_ICONS[self.color], self.value.capitalize())
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue