C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

Deck() публичный Метод

Initializes a new instance of the Deck class.
public Deck ( Game game ) : System
game Game The game.
Результат System

Deck() публичный Метод

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.
Результат System

Draw() публичный Метод

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.
Результат void

EnableAllCards() публичный Метод

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].
Результат void

FlipAllCards() публичный Метод

Method to toggle the visibility of all cards in the deck.
public FlipAllCards ( ) : void
Результат void

GetCard() публичный Метод

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.
Результат Card

GetCard() публичный Метод

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.
Результат Card

Has() публичный Метод

Determines whether [has] [the specified rank].
public Has ( CardRank rank, CardSuit suit ) : bool
rank CardRank The rank.
suit CardSuit The suit.
Результат bool

Has() публичный Метод

Determines whether [has] [the specified number].
public Has ( int number, CardSuit suit ) : bool
number int The number.
suit CardSuit The suit.
Результат bool

MakeAllCardsDragable() публичный Метод

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].
Результат void

Shuffle() публичный Метод

Shuffles the the deck's cards list one time.
public Shuffle ( ) : void
Результат void

Shuffle() публичный Метод

Shuffles the deck's cards list specified number of times.
public Shuffle ( int times ) : void
times int The number of times.
Результат void

Sort() публичный Метод

Sorts the cards in the deck using the Game's suit comparer.
public Sort ( ) : void
Результат void

ToString() публичный Метод

Returns a System.String that represents this instance.
public ToString ( ) : string
Результат string