view module¶
-
class
view.TerminalView[source]¶ Bases:
objectHandles input and output from a Game. You should switch into a different mode while reading this file: here, it’s about the “skin” the game – like a user interface – whereas over in game.py it’s about the algorithms and interactions.
Most important point: The View has no idea what is going on in the game, it just give messages for particular events.
-
CARD_ACTION_MESSAGES= {'draw-two': '{next_player.name} drew two cards!', 'reverse': 'Change directions!', 'skip': 'Skipped {next_player.name}!', 'wild': '{player.name} set the color to {card.color}', 'wild-draw-four': '{next_player.name} drew four cards and set the color to {card.color}'}¶
-