C# Class Bridge.Domain.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 ( ) : System.Collections.Generic
GetCard ( Rank rank, Suit suit ) : Card

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

GetCard ( int number, Suit suit ) : Card

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

Has ( Rank rank, Suit suit ) : bool

Determines whether [has] [the specified rank].

Has ( int number, Suit suit ) : bool

Determines whether [has] [the specified number].

RemoveCard ( Card card ) : void
ToString ( ) : string

Method Details

Deck() public method

public Deck ( ) : System.Collections.Generic
return System.Collections.Generic

GetCard() public method

Gets the first matching card in the deck matching the specified suit and rank.
public GetCard ( Rank rank, Suit suit ) : Card
rank Rank The rank to match.
suit Suit 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, Suit suit ) : Card
number int The number of the rank to match.
suit Suit The suit to match.
return Card

Has() public method

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

Has() public method

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

RemoveCard() public method

public RemoveCard ( Card card ) : void
card Card
return void

ToString() public method

public ToString ( ) : string
return string