cards
index
cards.py

#########
# Cards #
#########

 
Modules
       
os
random
sys

 
Classes
       
Card
Deck
Game
Player

 
class Card
     Methods defined here:
__init__(self, suit, value, suitdict=None, valset=None)
__str__(self)
getcolor(self)
getsuit(self)
getvalue(self)

 
class Deck
     Methods defined here:
__init__(self, suitdict=None, valset=None, mergedecks=None)
#defines a deck
addcard(self, card)
addcards(self, cards)
countdeck(self)
drawcard(self)
drawcards(self, count)
drawrandomcard(self)
drawrandomcards(self, count)
getdeck(self)
getsuitdict(self)
getvalueset(self)
printdeck(self)
removecard(self, card)
removecards(self, cards)
shuffle(self)

 
class Game
     Methods defined here:
__init__(self, deck=None, playergroup=None, observergroup=None, gametype=None)
#defines a game
addplayer(self, player)
addplayers(self, players)
cleardeck(self)
cleargametype(self)
clearplayers(self)
countplayers(self)
deal(self, toeach)
getdeck(self)
getgametype(self)
getplayerat(self, at)
getplayers(self)
observe(self)
play(self)
removeplayer(self, player)
removeplayerat(self, at)
removeplayers(self, players)
setdeck(self, deck=None)
setgametype(self, gametype=None)
setplayers(self, playergroup=None)

 
class Player
     Methods defined here:
__init__(self, game=None, hand=None, name='', observer=False)
#defines a player
__str__(self)
acceptcard(self, card)
acceptcards(self, cards)
addcard(self, card)
addcards(self, cards)
clearhand(self)
drawcard(self)
drawcards(self, count)
drawrandomcard(self)
drawrandomcards(self, count)
getgame(self)
gethand(self)
getname(self)
isobserver(self)
observe(self)
play(self)
removecard(self, card)
removecards(self, cards)
setgame(self, game)
sethand(self, hand=[])
setname(self, name)
setobserver(self, observer=False)

 
Functions
       
makedeck(suitdict=None, valset=None)

 
Data
        defaultsuits = {'clubs': 'black', 'diamonds': 'red', 'hearts': 'red', 'spades': 'black'}
defaultvalues = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']