deck module¶
-
class
deck.Deck(filename=None)[source]¶ Bases:
objectCreates a uno Deck object. This reads in cards from a CSV file and stores them for use by the UnoGame object.
- Parameters
filename (str) – Path to the file containing uno cards as strings
empty (bool) – Whether the deck is generated with or without cards
-
read_cards_from_file(filename)[source]¶ Reads cards from text file. Uses basic deck if execption encountered during read. Cards should be in the form COLOR,NUMBER,SPECIAL-TYPE (i.e red,1, or red,,draw-four)
- Parameters
filename (str) – file to look for cards in
- Returns
The list of cards created in the deck
- Return type
list of Card