Trickster Bot Classes

For NuGet package version 1.10.1.

C# classes, interfaces, and enums shared between bots and Trickster Cards production code.

BidAfterPassBidBaseBidExplanationBidSpaceBridgeBiddingSchemeBridgeOptionsBridgeVariationCardChatLevelChicagoPartscoreDeckBuilderDeckTypeEuchreBidEuchreBidStyleEuchreBidTypeEuchreCallTrumpEuchreJokerTurnedUpEuchreLeadTrumpEuchreMisdealEuchreOptionsEuchreVariationFiveHundredBidFiveHundredNulloPointsFiveHundredOpenNulloPointsFiveHundredOptionsFiveHundredVariationFiveHundredWhenNulloFixedDealsGameCodeGameOptionsGamePlayModeGameVisibilityHandHeartsDumpPointsHeartsLeadHeartsOptionsHeartsPassingHeartsShootMoonScoringLeadSpadesWhenMeldMeldInfoMiniBridgeBidLevelsNulloGetsKittyOhHellFailedBidOhHellLeadTrumpOhHellMadeBidOhHellOptionsOhHellVariationPinochleBidStylePinochleKittyPinochleMeldPinochleMeldsPinochleMercyRulePinochleOptionsPinochlePassPinochleScoringPinochleTrickPlayPinochleTrickScoringPitchDrawOptionPitchFirstLeadPitchOptionsPitchPlayTrumpPitchVariationPlayerBasePlayToRankSpadesBlindBidsSpadesFailBidScoringSpadesMercyRuleSpadesNilBidsSpadesNilOrZeroSpadesOptionsSpadesRenegeSpadesVariationSuggestBidState<T>SuggestCardState<T>SuggestDiscardState<T>SuggestPassState<T>SuggestStateBase<T>SuitSuitColorSuitRankWhistKittySizeWhistOptionsWhistSportKittyWhistVariation

public class BidBase

Base class of Bid object used to send bid, bid text, and other info to the client.

Includes a set of constants for bids that are not the winning bid.

public const int Dummy

Player is the dummy in bridge

public const int NoBid

Player has not yet bid

public const int NotPlaying

Player is not participating in the current hand, e.g., the partner of a Euchre “loner”

public const int Pass

Player has passed

public BidExplanation explanation

Information displayed to the player in a popup over the bid

public string text

The text displayed for the bid

public int value

The numeric value of the bid

public class BidExplanation

Explains a bid in the bidding box. Information is used to format a popup. Used primarily in Bridge.

public enum BidSpace

Base values for each game’s bids. Each game gets a bid space of 100 or more.

Games typically have a Bid class or helper methods to convert from the global bid space to bids that make sense for the game.

public enum EuchreBid

Defines values in Euchre’s BidSpace.

public class FiveHundredBid : IComparable<FiveHundredBid>, IEquatable<FiveHundredBid>

Helper for dealing with bids in 500.

public class MeldInfo

Object details a Pinochle Meld

public int points

Points for the meld

public string detailHtml

HTML detail of the meld.

public List<Card> cardsUsed

The cards comprising the meld.

public enum Rank

The ranks of cards.

The enum values do not necessarily correspond to the numeric rank of the card in any given game. Use the game’s RankSort method to sort cards by rank.

public enum Suit

The suits of cards.

Includes Suit.Unknown and Suit.Joker in addition to the standard 4 suits.

public enum SuitColor

The color of a card. Computed from the suit.

public class SuitRank

Object representing the suit and rank of a card.

public Suit suit

The suit of a card.

public Rank rank

The rank of a card

public class Card : SuitRank

Object representing a card.

Extends SuitRank with an isTrump flag and helpers.

public bool isTrump

Flag indicates whether the card is of the trump suit.

public bool IsHonorRank

Helper property that returns true if the standard rank of the card is Jack through Ace.

public SuitColor Color

The computed color of the card.

public bool SameAs(Card other)

Method to determine if the suit and rank of card matches this card.

This class does not implement IEqualityComparer so use method to compare cards for equality.

public static class DeckBuilder

Utility class for creating decks.

public static List<Card> BuildDeck(DeckType dtype)

Builds a deck of the given type.

public static int DeckSize(DeckType type)

Returns the size of a deck of the given type.

public enum DeckType

Enum of deck types.

Std52Card – Standard 52-card deck
Std53Card – Standard deck plus 1 joker
Std54Card – Standard deck plus 2 jokers
SpadesWithJokers – Standard deck plus 2 jokers but without ♥2 and ♣2
FiveHundred43Card – Ranks 4-A plus 1 joker but without ♣4 and ♠4
FiveHundred45Card – Ranks 4-A plus 1 joker
FiveHundred46Card – Ranks 4-A plus 2 jokers
TwoAndNineToAce – Ranks 2, 9-A
TwoAndNineToAceAndJoker – Ranks 2, 9-A plus 1 joker
FiveToAce – Ranks 5-A
FiveToAceAndJoker – Ranks 5-A plus 1 joker
SevenToAce – Ranks 7-A
SevenToAceAndJoker – Ranks 7-A plus 1 joker
EightToAce – Ranks 8-A
EightToAceAndJoker – Ranks 8-A plus 1 joker
NineToAce – Ranks 9-A
NineToAceAndJoker – Ranks 9-A plus 1 joker
No2C_51Card – Standard deck but without the ♣2
No2D_51Card – Standard deck but without the ♦2
DD_NineToAce – Ranks 9-A with 2 cards of each rank
No4s_50Card – Standard deck plus 2 jokers but without any 4s
FiveHundred63Card – Ranks 2-13 plus 1 joker but without ♣13 and ♠13
FiveHundred65Card – Ranks 2-13 plus 1 joker
FiveHundred66Card – Ranks 2-13 plus 2 jokers
Pinochle80 – Ranks 10-A with 4 cards of each rank
No2C2D_50Card – Standard deck but without ♣2 and ♦2
No2C2D2S3C_48Card – Standard deck but without ♣2, ♦2, ♠2, and ♣3
FiveHundred33Card – Ranks 7-A plus 1 joker
TenToAce – Ranks 10-A
TenToAceAndJoker – Ranks 10-A plus 1 joker
DD_JackToAce – Ranks J-A with 2 cards of each rank
DD_JackToAceAndJoker – Ranks J-A plus 1 joker with 2 cards of each rank
DD_TenToAce – Ranks 10-A with 2 cards of each rank
DD_TenToAceAndJoker – Ranks 10-A plus 1 joker with 2 cards of each rank
DD_NineToAceAndJoker – Ranks 9-A with 2 cards of each rank
DD_EightToAce – Ranks 8-A with 2 cards of each rank
DD_EightToAceAndJoker – Ranks 8-A plus 1 joker with 2 cards of each rank
DD_SevenToAce – Ranks 7-A with 2 cards of each rank
DD_SevenToAceAndJoker – Ranks 7-A plus 1 joker with 2 cards of each rank

public class Hand : List<Card>

Collection of Cards with helper methods.

public Hand(IEnumerable<Card> cards)

Constructs a Hand object from an enumerable collection of Cards.

public Hand(string serializedCards)

Constructs a Hand object from the string representation of cards.

public bool ContainsCard(Card card)

Answers whether a Card is in this Hand.

public bool ContainsSuitAndRank(Suit suit, Rank rank)

Answers whether a Card with a given Suit and Rank is in this Hand.

public Card RemoveCard(Card card)

Removes a Card from this Hand. Returns the removed Card or null if not present.

public Hand RemoveCards(IEnumerable<Card> cards)

Removes an enumerable collection of Cards from this Hand. Returns the modified Hand.

public Card RemoveSuitRank(Suit suit, Rank rank)

Removes a Card with a given Suit and Rank from this Hand. Returns the removed Card or null if not present.

public override string ToString()

Returns a serialized representation of this Hand.

public Card RemoveFirstCard()

Removes and returns the first Card from the Hand.

Thows exception if no Cards.

public List<Card> RemoveAndReturn(IEnumerable<Card> cards)

Removes an enumerable collection of Cards from the Hand.

Returns the passed-in Cards as a List.

public Hand AddCards(IEnumerable<Card> cards)

Adds an enumerable collection of Cards to the Hand. Returns the modified Hand.

public enum BridgeVariation

Bridge variations: Chicago, Rubber, MiniBridge, or Duplicate

public enum BridgeBiddingScheme

Bridge bidding schemes: SAYC or Custom.

public enum MiniBridgeBidLevels

MiniBridge choice of legal bids.

public enum ChicagoPartscore

Chicago bridge partscore handling: Bonus or Carryforward.

public class BridgeOptions : GameOptions

Game options for Bridge

public bool allowUndo

Whether undo is allowed in the game.

public bool allowUndoBids

When allowUndo is false, this determines if only bids may be undone.

public BridgeBiddingScheme bidding

Bidding scheme being used.

public MiniBridgeBidLevels miniBridgeBidLevels

Bidding style being used.

public ChicagoPartscore chicagoPartscore

How partscores are handled in Chicago bridge.

public override GameCode gameCode

GameCode associated with these options

public override DeckType deckType

The type of deck used for these options

public bool goodPracticeHandToSeatZero

If true, we rotate the hands to give the practice player the hand with the highest HCP.

public bool honorsBonus

Flag whether to score honors bonus.

public bool noTransfers

Flag indicating whether the bot will play with transfers (SAYC only).

public int rubberDealLimit

Fixed number of deals in rubber bridge. 0 = unlimited.

public int rubberLimit

Number of rubbers to play in rubber bridge.

public BridgeVariation variation

Bridge game variant: Chicago or rubber.

public bool withCappelletti

Flag indicating whether the bot will play with the Cappelletti convention (SAYC only).

public enum EuchreBidStyle

Euchre bidding style

Single – Each player gets one bid; high bid wins
Auction – Bidding continues until all but one player has passed

public enum EuchreBidType

Euchre kind of first bid (either just level or level and suit together).

Level – Players bid only a level initially, then the maker chooses the suit.
LevelAndSuit – Players bid both a level and suit together for each bid.

public enum EuchreJokerTurnedUp

Trump and bid behavior when a Joker is the up card

Spades – Spades is trump
DealerBidsBlind – Dealer takes bid and chooses trump before looking at cards

public enum EuchreLeadTrump

When Trump can be led

Anytime – Anytime
OnceBroken – After another player trumped-in
AfterFirstTrick – After the first trick

public enum EuchreMisdeal

If and when a misdeal may be called

Never – Never
AceNoFace – If holding 1 ace but no face cards
NoAceNoFace – If holding no aces and no face cards
NoFaceMaybeAce – Holding no face cards and maybe 1 ace

public enum EuchreCallTrump

When a bidder may order-up trump during the first round of bidding

AnyTrump – Must be holding any trump card, including off-jack
WithNatural – Must be holding a natural trump, does not include off-jack
Anytime – Trump can be called anytime

public enum EuchreVariation

Whether bidding is classic Euchre style or Bid Euchre style.

public class EuchreOptions : GameOptions

Game options for Euchre

public EuchreVariation variation

Whether bidding is classic or trick-based.

public EuchreMisdeal allowMisdeal

Indicates whether and when game allows calling misdeal

public bool allowNotrump

Indicates the game allows a No Trump bid.

public bool allowLowNotrump

Indicates the game allows high/low No Trump bids.

public bool aloneLeadsLeft

Indicates that the lead play is to the left of an “alone” bidder.

public bool aloneTake5

Indicates the player who goes alone must take all 5 tricks or be Euchre’d.

public bool aloneWorth2

A successful “alone” bid is worth 2 points instead of 4.

public EuchreBidStyle biddingStyle

Indicates if bidding continues until everyone passes (Bid Euchre only)

public EuchreBidType bidType

Indicates if level and suit are bid together in a single bid instead of separately (Bid Euchre only)

public bool callForBest

Indicates that a player going alone exchanges 1 card with their partner.

public EuchreCallTrump callTrump

When a bidder may order-up trump in the first round of bidding.

public bool dealerBidsFirst

Makes bidding start with the dealer instead of the dealer’s left-hand opponent.

public bool dealerForcesAlone

Requires that the partner of the dealer bid “alone” or pass. They cannot order up the suit.

Popular with players in Canada.

public int deckSize

The number of cards in the deck excluding the joker.

Joker is added if withJoker option is true.

public bool defendAlone

Indicates the game prompts to defend alone if opponents went alone.

When set, SuggestBid may be asked to decide defend alone or pass if opponents went alone.

public bool defendAloneAnytime

Indicates the game prompts to defend alone anytime.

When set, SuggestBid may be asked to decide defend alone or pass.

public override GameCode gameCode

GameCode associated with these options

public override DeckType deckType

The type of deck used for these options

public bool goUnder

Indicates the game offers players with 3 or more of the lowest 2 cards to swap them for 3 undealt cards.

When set, SuggestBid may be asked to decide to go under or pass.

public EuchreJokerTurnedUp jokerTurnedUp

Trump and bid behavior when a Joker is the up card

public EuchreLeadTrump leadTrump

When trump may be led

public bool makerLeadsFirst

Indicates if the winning bidder leads the first trick, unless alone with aloneLeadsLeft enabled (Bid Euchre only)

public int minBid

The minimum number of tricks that can be bid (Bid Euchre only)

public bool noAlone

When true, no alone bids are offered

public int numDecks

The number of decks to use.

public bool offerAloneCall2

Controls whether we offer the Alone Call for 2 bid. Bid Euchre only.

public bool scoreOnlyBid

When set, a successful make scores only the value of the bid. Bid Euchre only.

public bool stickTheDealer

Requires the dealer to bid if the other players passed during the second round of bidding

public bool superEuchre

Indicates the game scores taking no tricks as a 4-point Super Euchre for the opponents.

public bool take4for1

Requires the bidder take 4 cards to get 1 point or they are Euchre’d.

public bool withJoker

Indicates the deck contains a joker.

public bool withKitty

Indicates the bid winner gets a kitty. Bid Euchre only.

public enum FiveHundredVariation

The 500 game variation.

American – American rules
Australian – Australian rules

public enum FiveHundredWhenNullo

Values for when players can bid Nullo/Misère

Anytime – Can be bid anytime
After7 – Can only be bid after a prior 7-level bid
Off – Nullo/Misère is not offered

public enum FiveHundredOpenNulloPoints

The points awarded for achieving Open Nullo/Misère

This also impacts which bids can be made following an Open Nullo/Misère bid

FiveHundred – 500 points
FiveHundredTwenty – 520
FourHundredThirty – 530
ThreeHundredThirty – 330

public enum FiveHundredNulloPoints

The points awarded for achieving Nullo/Misère

This also impacts which bids can be made following a Nullo/Misère bid

TwoHundredFifty – 250
TwoHundredThirty – 230
TwoHundredTen – 210

public enum NulloGetsKitty

When a player bidding Nullo/Misère gets the kitty/widow.

Always – Always
Never – Never
UnlessOpen – When bidding Nullo/Misère but not Open Nullo/Misère

public enum BidAfterPass

When a player who has previously passed may bid again.

Never – Never
Always – Always
IfBidChanged – Players who passed can bid if a bidding player raised their bid or changed the suit

public class FiveHundredOptions : GameOptions

Game options for 500

public BidAfterPass bidAfterPass

Indicates when, if ever, a bidder who passed may bid.

public bool bidderGoesOut

Indicates bidder wins if both teams go over 500.

public int deckSize

Size of the deck

deckSize is 40 plus number of cards in kitty/widow

public override GameCode gameCode

GameCode associated with these options

public override DeckType deckType

The type of deck used for these options

public bool jokerLowInNullo

Indicates that the jokers are low when bid is misère or open misère

public bool highBidderMayRaise

Indicates the high bidder may raise their bid after everyone else passes.

public bool mustBidToWin

Indicates that to be declared the winner, you must have been the bidder.

public NulloGetsKitty nulloGetsKitty

Determines if a Nullo/Misère bidder gets the kitty/widow.

public FiveHundredNulloPoints nulloPoints

The points associated with a Nullo/Misère bid.

public bool openNulloAfter8

Indicates that Open Nullo/Misère may only be bid after someone has bid at the 8-level.

public FiveHundredOpenNulloPoints openNulloPoints

The points associated with an Open Nullo/Misère bid.

public bool S8Overbid250Nullo

Indicates whether an 8♠ bid overbids a Nullo/Misère bid.

public FiveHundredVariation variation

Variation of the game. Mostly impacts defaults and terminology. In the American version, the 6-level bids of the first two players to bid are special bids called “inkles.”

public FiveHundredWhenNullo whenNullo

Determines when Nullo/Misère can be bid.

public override Suit EffectiveSuit(Card c, Suit trumpSuit)

Returns the effective suit of a card, which may be different than its standard suit. Used to return the proper rank for jokers and off-jacks

The card whose effective suit we return

The current trump suit

The effective suit of the card

public override int RankSort(Card c, Suit trumpSuit)

Returns a card’s rank sort order given the trump suit and current options

The card whose rank sort we return

The current trump suit

An integer that can be used to compare the ranks of two cards

public enum GameCode

An enum value representing the game.

Hearts – Hearts
Spades – Spades
Euchre – Euchre
Pitch – Pitch
Bridge – Bridge
FiveHundred – 500
OhHell – Oh Hell
Pinochle – Pinochle
Whist – Whist

public enum GamePlayMode

The mode of the game

Practice – Practice
Automatch – Play
Compete – Compete
InviteOnly – Join

public enum ChatLevel

What chat, if any, is available in the game

Full – Full text chat + video/voice chat in Join games
None – No chat
Presets – Presets and emojis only

public enum GameVisibility

Who can see a Join game

FriendsOfFriends – Friends of players in the game
MustBeInvited – Only invited players

public enum FixedDeals

Enum for the number of fixed deals in the game

None – No fixed deals; play to game-over score
One – 1
Two – 2
Three – 3
Four – 4
Five – 5
Six – 6
Seven – 7
Eight – 8
Twelve – 12
Sixteen – 16

public enum PlayTo

Whether the game is played for a fixed number of deals to the game-over score

Score – Played to game-over score
FixedDeals – Played for a fixed number of deals

public abstract class GameOptions : IGameOptions

Game options common to all games.

public bool allowUploadedDecks

If true, decks can be uploaded in Join and Practice games.

public bool autoplayForced

If true, client autoplays forced cards -- overriding the user’s setting of the same. If false, user’s setting is used.

public bool canWatchFaceUp

If true, allows watchers to watch face-up

public ChatLevel chatLevel

The amount of chat, if any, available to players in the game.

public FixedDeals fixedDeals

The number of deals, if playing a fixed number

public long gameOverScore

The game-over score

public GamePlayMode gamePlayMode

Mode of the game: Play, Join, Practice or Compete

public GameVisibility gameVisibility

Who can see this game, if it’s a Join game

public bool hidePlayerPoints

If true, the display of points accumulated by player name is hidden.

public bool isClubEventGame

Indicates whether this is a Club event game

public bool isCustom

Flag indicating that this game was created using the More Games/Rules form

Used only to award the player the “House Rules” achievement

public bool isFaceUp

Flag indicating that all cards in a Join or Practice game are displayed face-up

public bool isLesson

Flag indicating that this game is a practice lesson

public bool isRecordingLesson

Flag indicating that this game is a practice lesson being recorded

public bool isPartnership

Indicates whether this is team (partnership) or solo (individual) game

true can mean a 2- or 3-player partnership

public bool isTwoTeams

Modifies isPartnership to indicate 2 teams of half the number of players each

Currently only used in a 6-player game for 2 teams of 3

public bool noSuggestions

Flag to disable suggestions in the game

public bool noWatching

Flag to disable watching the game

public int players

The number of players in the game

public PlayTo playTo

Indicates whether the game is played for a fixed number of hands or to a game-over score

public bool randomSeats

Flag to randomly assign seats at the start of the game

public bool reviewLastDeal

Indicates whether the game uses “Review last deal”

public string scheduledStart

Scheduled start time (UTC) for a future game

null means game is not scheduled

public int secondsToBid

The number of seconds the player has to bid or pass; zero for unlimited

public int secondsToPlay

The number of seconds the player has to play a card; zero for unlimited

public int stakes

The buy-in stakes for a Compete mode game

public bool useDuplicateScoring

Indicates that the game uses duplicate scoring

public enum HeartsShootMoonScoring

How shoot moon is scored in Hearts

alwaysAdd – 26 points always added to opponents
alwaysSubtract – 26 points always subtracted from shooter
auto – 26 points added to opponents unless that causes the game to be over with the shooter losing. Then 26 points are subtracted from the shooter

public enum HeartsPassing

Passing pattern for Hearts

None – No passing
AlwaysLeft – All passes to the player on the left
AlwaysRight – All passes to the player on the right
LeftRightAcross – Passes alternate left, right, across
LeftRightAcrossKeep – Passes alternate left, right, across, and a keeper hand
AlwaysAcross – All passes to the player across
Around – Pass rotates around clockwise
AroundKeep – Pass rotates around clockwise with a keeper hand

public enum HeartsLead

The player that leads a Hearts hand

LowestClub – Player with the lowest club, typically the ♣2
LeftOfDealer – Player left of the dealer

public enum HeartsDumpPoints

The possible values of the Hearts dumpPoints option

AfterFirstTrick – Points cannot be dumped on the first trick
Anytime – Points may be dumped on the first trick

public class HeartsOptions : GameOptions

Game options for Hearts

public HeartsDumpPoints dumpPoints

Option indicating whether points can be played on the first trick.

public override GameCode gameCode

GameCode associated with these options.

public override DeckType deckType

The type of deck used for these options

public bool jackOfDiamonds

Flag indicating that capturing the Jack of Diamonds is worth -10 points.

Cannot be set if jackOfDiamondsForMinus5 is set.

public bool jackOfDiamondsForMinus5

Flag indicating that capturing the Jack of Diamonds is worth -5 points.

Cannot be set if jackOfDiamonds is set.

public int JackOfDiamondsValue

The value of the Jack of Diamonds: 0, -5 or -10.

public int maxHandScore

The maximum hand score. 13 or 26 depending on whether the Queen of Spades is worth 13.

public bool minus50for100

Indicates that 50 points are subtracted from scores of exactly a multiple of 100 points

public bool minus50for50

Indicates that 50 points are subtracted from scores of exactly a multiple of 50 points

public bool noBlackLady

Flag disables the Queen of Spades if set

public HeartsPassing passing

The passing pattern

public bool qsAfterHearts

Indicates that ♠Q may not be dumped until Hearts is broken

public bool qsBreaksHearts

Indicates that ♠Q breaks Hearts the same as the first dumped Heart

public HeartsShootMoonScoring scoreShootMoon

How shoot the moon is scored

public bool shootAlone

If set in a team game, shooting the moon requires that just one player shoots

public enum OhHellVariation

The various Oh Hell deal patterns

TenToOneToTen – 10..1..10
OneToTenToOne – 1..10..1
TenToOne – 10..1
OneToTen – 1..10
SevenToOneToSeven – 7..1..7
OneToSevenToOne – 1..7..1
SevenToOne – 7..1
OneToSeven – 1..7
TwelveToOneToTwelve – 12..1..12
OneToTwelveToOne – 1..12..1
TwelveToOne – 12..1
OneToTwelve – 1..12
CustomRamp – Custom ramp defined by rampStartAt, rampSwitchAt, rampEndAt, rampStartingIncrement

public enum OhHellLeadTrump

When Trump can be led

Anytime – Anytime
OnceBroken – After another player trumped-in
AfterFirstTrick – After the first trick

public enum OhHellMadeBid

How failed (not on-the-nose) bids are scored

One – Made bids score 1x bid + 10
Two – Made bids score 2x bid + 10
Three – Made bids score 3x bid + 10
Ten – Made bids score 10x bid + 10
Squared – Made bids score bid^2 + 10

public enum OhHellFailedBid

How failed (not on-the-nose) bids are scored

ScoreTricks – Failed bids score 1 point per trick taken
ScoreZero – Failed bids score 0
MinusTricksOff – Failed bids score negative the number of tricks off from the bid
Minus5xTricksOff – Failed bids score negative 5x the number of tricks off from the bid

public class OhHellOptions : GameOptions

Game options for Oh Hell

public OhHellFailedBid failedBids

How failed bids are scored

public override GameCode gameCode

GameCode associated with these options

public override DeckType deckType

The type of deck used for these options

public bool hookRule

Indicates “hook rule” is in effect. This requires the sum of the bids to not equal the number of cards dealt

public OhHellLeadTrump leadTrump

When trump may be led

public bool parallelBidding

Indicates that all players bid simultaneously

public int rampEndAt

The ramp end number of cards dealt. Make equal to ramp switch for a one-direction ramp.

public int rampStartAt

The ramp start number of cards dealt

public int rampStartingIncrement

The starting increment. Either -1 or 1. Computed from rampStartAt and rampSwitchAt.

public int rampSwitchAt

The ramp switch number of cards dealt

public int TotalHandsInGame

A computed value of the total hands in the game using the current deal pattern

public OhHellMadeBid trickPoints

The points per trick added to 10 for a successful bid

public OhHellVariation variation

The deal pattern

public enum PinochleMeld

An enum of the supported Pinochle melds

public static class PinochleMelds

A helper class for working with Pinochle Melds

public class Meld

A class representing a single Pinochle Meld

public Hand Cards

The cards comprising the meld

public MeldGroup Group

The group of the meld

public PinochleMeld m

The meld type

public int n

Count of melds of this type

public string Name

The display name of this meld

public int Points(PinochleOptions options)

Point value of the meld given the PinochleOptions passed

public enum PinochleBidStyle

Pinochle bidding style

Auction – Bidding continues until all but one player has passed
Single – Each player gets one bid; high bid wins

public enum PinochleKitty

Number of cards in the kitty

None – No kitty
ThreeCard – 3
FourCard – 4

public enum PinochleMercyRule

If and when a mercy rule applies

None – No mercy rule
MinusHalfGameScore – If any player’s score reaches negative half the game score
MinusGameScore – If any player’s score reaches negative the game-over score
DeltaGameScore – If the difference between the highest and lowest score is greater than or equal to the game over score

public enum PinochlePass

Who passes, if anyone

NoPass – No passing of cards between partners
DeclaringTeamOnly – The partners of the declaring team exchange cards
BothTeams – The partners of both teams exchange cards

public enum PinochleTrickPlay

Trick play requirements

MustHeadAllLeads – Players must always beat the other cards in the trick, if possible
MustHeadTrumpLead – Players must beat the other trump cards in the trick, if possible, when trump is led
MustHeadNever – No requirement to beat other cards in the trick

public enum PinochleTrickScoring

What ranks are valuable. Sum is always 30 points per suit (3 if modern scoring)

AceTenKingOnly – Ace, Ten, and King are each worth 10 points (1 if modern scoring)
Classic – Ace = 11, Ten = 10, King = 4, Queen = 3, and Jack = 2 points (classic only)
Simplified – Ace = 10, Ten = 10, King = 5, Queen = 5 points (classic only)

public enum PinochleScoring

The scoring scheme in use

Classic – 10x values
Modern – 1x values

public class PinochleOptions : GameOptions

Game options for Pinochle

public bool allowMisdeal

True means a player with 5 or more 9s can call a misdeal as their first bid. Single deck only.

public bool askToShoot

Causes the game to ask if the declarer want to shoot the moon

public bool bidderGoesOut

Indicates bidder wins if both teams go over the game-over score

public int BidIncrement

The increment for the bids: 10 or 1

public PinochleBidStyle bidStyle

The bid style: auction or single

public int ClassicTrickScoreForLastTrick

The value of the last trick taken: 20 for double deck, 10 for single

public bool doubleDeck

Indicates the game is double-deck

public bool doubleRoyalMarriage

Indicates a 300-point meld (30 for modern) is scored for a double royal marriage

public override GameCode gameCode

GameCode associated with these options

public override DeckType deckType

The type of deck used for these options

public PinochleKitty kitty

Whether a kitty is in use and, if so, how big

public int KittySize

int size of the kitty

public bool marriageOrBetter

Indicates that the declarer must have a marriage or better in trump or they automatically fold following melding

public int MaxTakeablePoints

Computed maximum points that can be captured during trick-taking

public PinochleMeldDisplayTime meldDisplayTime

The time, in milliseconds, to display each meld during meld display

public int MeldPointsMultiplier

Multiplier for the meld value: 10 or 1

public PinochleMercyRule mercyRule

When a mercy rules applies, if ever

public bool min20InMeld

Indicates the declaring team must have at least 20 points (200 in classic scoring) in meld or they automatically fold following melding

public bool min20InTricks

Indicates a team must take at least 20 points (200 in classic scoring) during trick-taking or they score zero

public int minBid

The minimum bid

public bool mustBidSetToWin

Requires the winner(s) to be either the bidder(s) who made their bid or the opponents who set the bidder(s)

public bool mustTrumpIfPossible

Requires a player void in the led non-trump suit, must play trump if they have any

public bool noDoublePinochle

Two pinochles score 80 points (8 for modern scoring) instead of 300 (30 for modern) for a double pinochle

public bool noThrowIn

True means we will not ask if players wish to throw in their hand

public bool offerPassWithHelp

Adds a “Pass with Help” bid (unimplemented)

public int passCount

The number of cards passed when whoPasses != PinochlePass.NoPass

public bool runWithExtras

Adds three more meld types: a 190-point “Run With Extra King,” a 190-point “Run With Extra Queen,” and a 230-point “Run With Extra Marriage.” If a player has one of these, they do not get credit for a simple run. Also, if both this option and “Double Royal Marriage” is on, “Double Royal Marriage” beats “Run With Extra Marriage.” Single deck only.

public PinochleScoring scoring

The scoring scheme: Classic or Modern. Classic values are 10x the Modern values.

public bool stickTheDealer

Requires the dealer to bid if the other players passed during the first round of bidding

public PinochleTrickPlay trickPlay

Whether players must head tricks and which ones.

public int TrickScoreDivisor

Divisor for the trick score: 10 or 1

public int TrickScoreForLastTrick

The value of the last trick adjusted for scoring style

public PinochleTrickScoring trickScoring

The ranks that count

public PinochlePass whoPasses

Who passes to their partners, if anyone

public enum PitchDrawOption

Indicates whether players can discard and refill after bidding

Available only in 4-, 5-, and 6-point; always “NonTrump” in 9-point.

None – No discard and refill
NonTrump – Players may discard non-trump and refill their hand from the deck after bidding completes

public enum PitchPlayTrump

Indicates when players can play trump

FollowSuit – Players may only play trump if void in the led suit
Anytime – Players may trump anytime
Only – Only trump cards are played

public enum PitchVariation

The point value of the Pitch game

Each point variation presents different options. The higher-point games are quite different from the lower-point games.

FourPoint – 4-point
FivePoint – 5-point
SixPoint – 6-point
SevenPoint – 7-point
TenPoint – 10-point
ElevenPoint – 11-point
ThirteenPoint – 13-point
NinePoint – 9-point

public enum PitchFirstLead

Who leads in the 5-player “call your partner” game

HighBidder – Default
CalledPartner – Only available in 5-player “call your partner” game

public class PitchOptions : GameOptions

Game options for Pitch

public bool dealerMaySteal

Allows the dealer to become the pitcher by matching the highest bid

public DeckType deck

Type of deck being used

public bool doubleBidIsSet

Deducts twice the bid from the score if the player takes points totaling exactly twice their bid

public PitchDrawOption drawOption

Indicates that players may discard non-trump and refill their hand

public PitchFirstLead firstLead

Indicates who leads in the 5-player “call your partner” game

public override GameCode gameCode

GameCode associated with these options

public override DeckType deckType

The type of deck used for these options

public int kitty

Indicates whether to give additional cards to the pitcher, after which they discard down to 6.

In 4-, 5-, 6-, and 9-point games this is a 3-card kitty. In 7-, 10-, 11-, and 13-point games this is all cards remaining in the deck and is always true unless playing with 5 or more players.

public bool lowGoesToTaker

Indicates if the point for the low trump card goes to the team that captures it (taker). If false, low goes to the team that was dealt it (holder).

public int minBid

The minimum bid

public bool mustBidToScore

Indicates players only earn points when you are the pitching team

public bool mustBidToWin

Indicates that you must bid to win. May be modified by setOpponentsAndWin so that either bidding or setting wins.

public bool offerShootBid

Indicates that we offer the shoot bid

public bool pitcherLeadsTrump

Requires the pitcher to lead trump on the first trick

public PitchPlayTrump playTrump

When you may play trump and if only trump is played

public bool scoreOnlyBid

Indicates that the pitching team only earns points equal to their bid

public bool setOpponentsAndWin

Indicates that you can win by setting your opponents. Used with mustBidToWin to result in Bid/Set to win.

public bool shootAllTricks

Indicates that shooting means you must take all tricks; otherwise, you just need to take all points.

public bool stickTheDealer

Requires the dealer to bid if the other players passed

public bool tenOfTrumpReplacesGamePoint

Indicates that one point is awarded for capturing the 10 of trump and there is no “game” point

public PitchVariation variation

The point variation of Pitch

public enum LeadSpadesWhen

When Spades can be led

OnceBroken – After another player sloughed spades
AfterFirstTrick – After the first trick
Anytime – Anytime

public enum SpadesNilBids

When nil bids are offered

Anytime – Always
LosingBy50 – When the player is losing by 50
LosingBy100 – When the player is losing by 100

public enum SpadesBlindBids

When blind bids are offered

Off – Never
Anytime – Always
LosingBy100 – When the player is losing by 100
LosingBy200 – When the player is losing by 200
LosingBy250 – When the player is losing by 250

public enum SpadesFailBidScoring

How failing to make bid is scored

ScoreZero – No penalty; just score 0
SetByBid – Subtract 10x the bid
SetByTricksShort – Subtract 10x the number of tricks short

public enum SpadesMercyRule

If and when a mercy rule applies

None – No mercy rule
Minus200 – If any player’s score reaches -200
MinusGameScore – If any player’s score reaches negative the game-over score
DeltaGameScore – If the difference between the highest and lowest score is greater than or equal to the game over score

public enum SpadesNilOrZero

The possible values of the nilOrZero option.

public enum SpadesRenege

The possible values of the renege option.

public enum SpadesVariation

The possible variations of Spades.

None – The traditional game played with 13 Spades ranked 2 through Ace
JokerJokerAce – Adds a red Joker (★H) as the highest Spade and black Joker (★L) as the second highest Spade while removing ♥2 and ♣2 from the deck
JokerJokerDeuceAce – Like Joker-Joker-Ace but ranks ♠2 above ♠A and below ★L
JokerJokerDeuceDeuce – Like Joker-Joker-Deuce-Ace but considers the ♦2 to be a Spade ranked above ♠2 and below ★L
Suicide – Played with partners. First partner’s bid is either Nil or at least 4 tricks; second partner may bid either Nil or the number of tricks bid by the first partner
Mirror – Each player must bid either the number of spades in their hand or go Nil
Whiz – Like mirror, each player bids the number of spades in their hand or goes Nil. No minimum bids for teams. Blind bidding is not allowed

public class SpadesOptions : GameOptions

Game options for Spades

public bool bidsCantTotalTricks

Flag indicating that bids cannot the number of tricks available, e.g., 13

public bool firstHandBidsItself

Flag indicating the tricks taken in the first hand determine scores

public SpadesBlindBids blindBids

If and when blind nils are offered

public SpadesBlindBids blindNonNilBids

If and when blind bids other than nil are offered

public int blindNilPass

The number of cards a blind nil bidder exchanges with their partner

public SpadesFailBidScoring failBidScoring

How failed bids are scored

public override GameCode gameCode

GameCode associated with these options

public override DeckType deckType

The type of deck used for these options

public bool highBidLeads

The high bidder (or first going left from dealer of equal high bids) leads.

public LeadSpadesWhen leadSpades

When spades may be led

public int loseIfSet

The number of sets that trigger an automatic loss

public bool lowClubFirstTrick

Players must play their lowest club on the first trick, if possible.

public SpadesMercyRule mercyRule

When a mercy rules applies, if ever

public int minBid

The minimum team bid

public int minBlindBid

The minimum non-nil blind bid

public FailedNilBags failedNilBags

Indicates whether overtricks on a failed Nil are (1) directly counted as bags, (2) added to the tricks taken by the Nil bidder’s partner, or (3) don’t take bags and aren’t added to the team score.

public SpadesNilOrZero nilOrZero

Indicates whether Nil or Zero is offered as a bid.

public int nilPass

The number of cards a nil bidder exchanges with their partner

public int nilPoints

The point value of making a nil bid

public SpadesNilBids canBidNil

When the player can bid Nil

public bool noSpadeFirstTrick

Players may not trump-in on the first trick

public SpadesRenege renege

Whether players are allowed to renege and what the penalty is

public bool tenBagsPenalty

Indicates whether we subtract 100 points when 10 bags are accumulated across hands. False means there are no bags; overtricks simply add 1 point.

public bool tenForTwoHundred

Indicates whether a bid of 10 scores +/- 200 points.

public SpadesVariation variation

The variation of Spades

public enum WhistVariation

Whist variation

Whist – Classic no-bid Whist
BidWhist – Bid Whist

public enum WhistKittySize

The kitty size

None – No kitty
Four – 4
Five – 5
Six – 6

public enum WhistSportKitty

If/when we show the contents of the kitty to other players

Never – Does not reveal the kitty (blind) to anyone but the high bidder
Trump – Reveals the kitty to all players for trump bids only (not for NT bids)
Always – Reveals the kitty to all players on every hand

public class WhistOptions : GameOptions

Game options for Whist

public bool bidderGetsKitty

Indicates that the cards in the kitty are added to the high bidder’s hand. They then discard an equal number of cards.

public bool bidderLeads

Indicates the high bidder leads the first trick. Otherwise, the player to the left of the dealer leads.

public int DeckSize

The number of cards in the deck

public bool defensiveScoring

Indicates the defending team is given points for tricks they take over 6. Otherwise, only the bidding team earn points.

public bool doubleForNT

Indicates scores an NT bid at twice the normal value for its level.

public bool extraHandIfTied

Indicates if an extra hand should be played if the teams are tied at the end of the game. Only applies if playing a fixed number of hands.

public bool no2xForBeatingNT

Indicates that a successful defense against NT does not score double. Only applies if both defensiveScoring and doubleForNT are true.

public override GameCode gameCode

GameCode associated with these options

public override DeckType deckType

The type of deck being used. Depends on the size of the kitty.

public bool honorsBonus

Indicates a bonus is awarded for holding 3 or 4 honors

public bool IsLowHigh

Indicates the low cards are considered the highest rank cards

public WhistKittySize kittySize

The kitty size enum value

public int KittySize

The int kitty size

public int loseIfSet

The number of sets that trigger an automatic loss

public bool lowBeatsHigh

Indicates a low (downtown) bid beats a high (uptown) bid of the same level

public int minBid

The minimum bid

public bool positiveScoring

Indicates the defending team is given points for the bid if the bidding team is set. Otherwise, points for the bid are subtracted from the bidding team’s score if they're set.

public WhistSportKitty sportKitty

Whether and when the kitty is shown

public WhistVariation variation

The variation of Whist: Classic or Bid

public class PlayerBase

Base class for a player. Has only the information needed by the bots' suggest methods.

public int Bid

The numeric bid value in BidSpace.

This value must be transformed into the bid space of a particular game in order for it to make sense. Games where bids consist of a suit and a value encode them in this 32-bit value.

public List<int> BidHistory

A list of player’s bid values in order.

public string CardsTaken

The string-representation of the cards taken so far by this player.

Convert this to a Hand object by using new Hand(player.CardsTaken).

public bool Folded

Flag indicating that this player has folded.

public long GameScore

The running game score of this player.

Bridge encodes the parts of the score into bit fields in this 64-bit long.

public Suit GoodSuit

If this is the first void off-suit a player has shown, we assume the sloughed suit is a “good suit” (they either have boss or are now void in trump).

This is still set when trumping in, but ignored until an off-suit is sloughed.

public string Hand

The string-representation of the cards in the player’s hand, if visible to bot.

Convert this to a Hand object by using new Hand(player.Hand)

public int HandScore

The hand score, or number of tricks taken this hand by this player.

public bool IsActivelyPlaying

Flag computed from Bid and Folded that indicates whether the player is currently participating in the play of the hand.

public List<PlayedCard> PlayedCards

The cards played by this player thus far in this hand.

public int Seat

The seat position of this player. Seats are numbered starting with 0. Can be used to determine partners and opponents.

public List<Suit> VoidSuits

The suits we belive this player is void in based on not following suit.

public class SuggestBidState<T> : SuggestStateBase<T> where T : IGameOptions

Object POSTed to the web bot endpoint for suggest bid.

Return value from the endpoint is a BidBase.

public BidBase cloudBid

The bid the existing cloud code would suggest.

public int dealerSeat

The seat of the dealer.

public Hand hand

The cards in the player’s hand.

public IReadOnlyList<BidBase> legalBids

List of legal bids. The BidBase returned by the SuggestBid method must be in this list.

public IReadOnlyList<PlayerBase> players

All the players in the game. Can be used to identify your partners in 6-player games.

public Card upCard

The turned-up Card in Euchre.

public Suit upCardSuit

The Suit of the turned-up Card in Euchre.

public IReadOnlyList<bool> vulnerabilityBySeat

List of whether each player is vulnerable by seat.

public SuggestBidState<T> SortCardMembers()

Sorts the cards in this object so that bot methods that rely on sort order return consistent results.

The object on which it was invoked

public class SuggestCardState<T> : SuggestStateBase<T> where T : IGameOptions

Object POSTed to the web bot endpoint for suggest card.

Return value from the endpoint is a Card.

public SuitRank cloudCard

The card the existing cloud code would suggest.

public IReadOnlyList<Card> cardsPlayed

The cards that have already been played in the hand.

public string cardsPlayedInOrder

The player seat and card of the cards that have already been played in the hand in the order they were played.

public Card cardTakingTrick

The current trick taking card, if any. May be null.

public bool isPartnerTakingTrick

Flag indicating whether the player’s partner is currently taking the trick.

public IReadOnlyList<Card> legalCards

The cards that are legal to play. The card returned by the SuggestCard method must be in this list.

public IReadOnlyList<PlayerBase> players

All the players in the game. Can be used to identify your partners in 6-player games.

public IReadOnlyList<Card> trick

Cards in the current trick, if any.

public PlayerBase trickTaker

The player who is currently taking the trick, if any.

public SuggestCardState<T> SortCardMembers()

Sorts the cards in this object so that bot methods that rely on sort order return consistent results.

trick is not sorted; the cards in the trick are in the order they were played.

The object on which it was invoked

public class SuggestDiscardState<T> : SuggestStateBase<T> where T : IGameOptions

Object POSTed to the web bot endpoint for suggest discard.

Return value from the endpoint is List&lt;Card&gt;. The number of cards suggested depends on the game and its options.

public List<Card> cloudDiscard

The discard the existing cloud code would suggest.

public Hand hand

The cards in the discarding player’s hand.

public SuggestDiscardState<T> SortCardMembers()

Sorts the cards in this object so that bot methods that rely on sort order return consistent results.

The object on which it was invoked

public class SuggestPassState<T> : SuggestStateBase<T> where T : IGameOptions

Object POSTed to the web bot endpoint for suggest pass.

Return value from the endpoint is a Hand.

public List<Card> cloudPass

The pass the existing cloud code would suggest.

public Hand hand

The cards in the passing player’s hand.

public int passCount

The number of cards expected to be returned.

public SuggestPassState<T> SortCardMembers()

Sorts the cards in this object so that bot methods that rely on sort order return consistent results.

The object on which it was invoked

public class SuggestStateBase<T> where T : IGameOptions

Base class of SuggestBidState, SuggestCardState, SuggestDiscardState, and SuggestPassState

public T options

The game rules options. T will be one of the GameOptions classes.

public PlayerBase player

The player being asked to play the card.

The hand member of the OtherPlayer object contains the cards remaining in the player’s hand.

public Suit trumpSuit

The suit of trump. Suit.Unknown represents a “No Trump” bid or game without trump.