C# Класс Belot.CardComparer

Compares two cards according to a given announcement.
This is needed for sorting purposes. For example Jack is bigger than Ace in game of All Trumps but in game of No Trumps is smaller.
Наследование: IComparer
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
CardComparer ( AnnouncementTypeEnum announcementType ) : System

Constructor for the class. Creates a new CardComparer object.

Compare ( object x, object y ) : int

Compares two cards

Приватные методы

Метод Описание
CardComparer ( ) : System

Constructor for the class. Creates a new CardComparer object. Compares in such order 7,8,9,10,J,Q,K,A

CompareCombinations ( Card cardX, Card cardY ) : int

Compares in such order 7,8,9,10,J,Q,K,A

CompareNoTrumps ( Card cardX, Card cardY ) : int

Compares in such order 7,8,9,J,Q,K,10,A

CompareTrumps ( Card cardX, Card cardY ) : int

Compares in such order 7,8,Q,K,10,A,9,J

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

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

Constructor for the class. Creates a new CardComparer object.
public CardComparer ( AnnouncementTypeEnum announcementType ) : System
announcementType AnnouncementTypeEnum
Результат System

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

Compares two cards
public Compare ( object x, object y ) : int
x object First card
y object Second card
Результат int