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

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

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

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

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

public Deck ( ) : System.Collections.Generic
Результат System.Collections.Generic

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

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

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

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

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

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

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

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

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

public RemoveCard ( Card card ) : void
card Card
Результат void

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

public ToString ( ) : string
Результат string