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.
Afficher le fichier Open project: anorsich/dds.net Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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

Deck() public méthode

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.
Résultat System

Draw() public méthode

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.
Résultat void

EnableAllCards() public méthode

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].
Résultat void

FlipAllCards() public méthode

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

GetCard() public méthode

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.
Résultat Card

GetCard() public méthode

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.
Résultat Card

Has() public méthode

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

Has() public méthode

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

MakeAllCardsDragable() public méthode

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].
Résultat void

Shuffle() public méthode

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

Shuffle() public méthode

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

Sort() public méthode

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

ToString() public méthode

Returns a System.String that represents this instance.
public ToString ( ) : string
Résultat string