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.
파일 보기 프로젝트 열기: anorsich/dds.net 1 사용 예제들

공개 메소드들

메소드 설명
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