view module

class view.TerminalView[source]

Bases: object

Handles 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}'}
show_beginning_turn(player, top_card)[source]
show_played_card(player, card)[source]
show_drawing_card(player)[source]
show_invalid_card(player, card, top_card)[source]
show_shuffling_deck()[source]
show_empty_decks()[source]
show_ending_turn(player)[source]
show_winning_game(player)[source]
show_out_of_cards()[source]
show_card_action(player, next_player, card)[source]