C# Class DdsPlay.Model.Deck

Class to represent a deck of cards, or a hand of cards, or any other collection of cards used in the game. I.e. the dealer's deck, or a stack of cards in a solitairre game, or a discard pile.
Show file Open project: anorsich/dds.net Class Usage Examples

Public Methods

Method Description
Deck ( Game game ) : System

Initializes a new instance of the Deck class.

Deck ( int numberOfDecks, int uptoNumber, Game game ) : System

Initializes a new instance of the Deck class.

Draw ( Deck toDeck, int count ) : void

Draws/Moves the specified amount of cards to the specified deck.

EnableAllCards ( bool enable ) : void

Method to set the value of Enabled to the provided value on all of the cards in the deck.

FlipAllCards ( ) : void

Method to toggle the visibility of all cards in the deck.

GetCard ( CardRank rank, CardSuit suit ) : Card

Gets the first matching card in the deck matching the specified suit and rank.

GetCard ( int number, CardSuit suit ) : Card

Gets the card in the deck matching the specified integer rank value and the specified suit.

Has ( CardRank rank, CardSuit suit ) : bool

Determines whether [has] [the specified rank].

Has ( int number, CardSuit suit ) : bool

Determines whether [has] [the specified number].

MakeAllCardsDragable ( bool isDragable ) : void

Method to set the value of the IsDragable on all of the cards in the deck.

Shuffle ( ) : void

Shuffles the the deck's cards list one time.

Shuffle ( int times ) : void

Shuffles the deck's cards list specified number of times.

Sort ( ) : void

Sorts the cards in the deck using the Game's suit comparer.

ToString ( ) : string

Returns a System.String that represents this instance.

Method Details

Deck() public method

Initializes a new instance of the Deck class.
public Deck ( Game game ) : System
game Game The game.
return System

Deck() public method

Initializes a new instance of the Deck class.
public Deck ( int numberOfDecks, int uptoNumber, Game game ) : System
numberOfDecks int The number of decks.
uptoNumber int The upto number.
game Game The game.
return System

Draw() public method

Draws/Moves the specified amount of cards to the specified deck.
public Draw ( Deck toDeck, int count ) : void
toDeck Deck To deck.
count int The count.
return void

EnableAllCards() public method

Method to set the value of Enabled to the provided value on all of the cards in the deck.
public EnableAllCards ( bool enable ) : void
enable bool if set to true [enable].
return void

FlipAllCards() public method

Method to toggle the visibility of all cards in the deck.
public FlipAllCards ( ) : void
return void

GetCard() public method

Gets the first matching card in the deck matching the specified suit and rank.
public GetCard ( CardRank rank, CardSuit suit ) : Card
rank CardRank The rank to match.
suit CardSuit The suit to match.
return Card

GetCard() public method

Gets the card in the deck matching the specified integer rank value and the specified suit.
public GetCard ( int number, CardSuit suit ) : Card
number int The number of the rank to match.
suit CardSuit The suit to match.
return Card

Has() public method

Determines whether [has] [the specified rank].
public Has ( CardRank rank, CardSuit suit ) : bool
rank CardRank The rank.
suit CardSuit The suit.
return bool

Has() public method

Determines whether [has] [the specified number].
public Has ( int number, CardSuit suit ) : bool
number int The number.
suit CardSuit The suit.
return bool

MakeAllCardsDragable() public method

Method to set the value of the IsDragable on all of the cards in the deck.
public MakeAllCardsDragable ( bool isDragable ) : void
isDragable bool if set to true [is dragable].
return void

Shuffle() public method

Shuffles the the deck's cards list one time.
public Shuffle ( ) : void
return void

Shuffle() public method

Shuffles the deck's cards list specified number of times.
public Shuffle ( int times ) : void
times int The number of times.
return void

Sort() public method

Sorts the cards in the deck using the Game's suit comparer.
public Sort ( ) : void
return void

ToString() public method

Returns a System.String that represents this instance.
public ToString ( ) : string
return string