Click or drag to resize
Ai Class
That's the base class of the ai class you write. It contains some methods and properties that should help you writing your code.
Inheritance Hierarchy

Namespace: Potbot.Gameplay.Ais
Assembly: PotBot (in PotBot.exe) Version: 0.9.0.1 (0.9.0.1)
Syntax
public abstract class Ai : MarshalByRefObject

The Ai type exposes the following members.

Properties
  NameDescription
Protected propertyAiStateObject
Ai developer's object to save data between rounds.
Protected propertyCurrentHandState
Returns the CurrentHandState object, with various methods/properties with information about the current hand.
Protected propertyHandValue

Returns Cactus Kev's number, which represents the strength of the hand. 1 is the best possible 5 card hand (Royal Flush), 7462 the worst (High Card 7). Before the flop this value = -1

HandValue 6186 - 7462: High Card hands

HandValue 3326 - 6185: One pair hands

HandValue 2468 - 3325: Two pairs hands

HandValue 1610 - 2467: Three of a kind hands

HandValue 1600 - 1609: Straight hands

HandValue 323 - 1599: Flush hands

HandValue 167 - 322: Full House hands

HandValue 11 - 166: Four of a Kind (Poker) hands

HandValue 2 - 10: Straight Flush hands

HandValue = 1: Royal Flush

HandValue -1: Not a 5 card hand (preflop)

Protected propertyHoleRank
Returns the number of the "value" of your pocketcards, where 0 is the best and 168 is the worst possible.
Public propertyName
Override this property to give your AI a name.
Protected propertyOverruleAllowed
Gets Or sets a value, indicating whether PotBot may overrule decisions from AIs of which he thinks they aren't good. Right now there is only one rule implemented, in which a FOLD is overruled to CHECK if possible.
Protected propertyPlayersManager
Returns the Playersmanager object, with various methods/properties.
Protected propertyPocketcard
Returns the pocketcard you specify, that you got dealt.
Protected propertyPotsManager
Returns the PotsManager object, with various methods/properties.
Top
Methods
  NameDescription
Protected methodAddDebugLine
Adds information to the Debug window.
Protected methodCheckOrCall
Use this method to call or check. This checks if you can check (owe nothing) or calls if you owe money to the pot(s).
Protected methodCheckOrFold
Use this method to check or fold. This checks if you can check (owe nothing) or folds if you owe money to the pot(s).
Protected methodDoFlushDrawCheck
This method determines whether you are holding a flush draw and if, detailed information about that draw in a FlushDrawCheckResult object. The definition of a flush draw is: Together, there are 4 or 5 cards of the same suit in your pockets and/or the board. Notice that a ready flush with 5 cards of the same suit will also be considered as a flush draw and return a proper FlushDrawCheckResult reference. If you do not have a flush draw, you will get a FlushDrawCheckResult reference, with all properties set to -1 in it. This method should only be called on the flop or on the turn, else you will receive a FlushDrawCheckResult reference, with all properties set to -1 in it.
Protected methodDoPairCheck
Examines and returns information about the 1 pair hand that you have.
Protected methodDoStraightDrawCheck
This method determines whether you are holding a staight draw and if, detailed information about that draw in a StraightDrawCheckResult object. The definition of a staight draw is: If there is exactly 1 card missing to make a straight AND if i have at least 1 of the 4 draw cards in my pockets. A finished straight will not be considered a straight draw. If you call the method having a finished straight you will get a StraightDrawCheckResult reference, with all properties set to 0 in it. Also, if you do not have a staight draw, you will get a StraightDrawCheckResult reference, with all properties set to 0 in it. This method should only be called on the flop or on the turn, else you will receive a StraightDrawCheckResult reference, with all properties set to 0 in it.
Protected methodFold
Use this method if you want to fold.
Protected methodGetNrOvercardsOnBridge
Returns the number of cards on the bridge, which have a higher face value than the higher one of my pocket cards. If there is no card on the bridge yet (preflop) 0 is returned.
Protected methodGetRandomInBetween
Little helper method, that returns a random number between start and ending (>= start and <= ending)
Public methodHandHasEnded
This method will be called after the hand has ended and the winners are paid. You can here e.g. see if your play was successful regarding your winnnings or do any other thing that you like.
Protected methodHasGoodSuitedConnectors
Determines whether your pockets are "good" suited connectors. "Good" means: Pockets that have a higher chance to win than average pocketcards. E.g. If you have 32s your chances to win in a showdown are lower than they would be holding random pocket cards. Also note that AJs for example has a higher chance to win than KQs if you play headsup, but the other way round if you play against 9 opponents. Consequently, if you call this method holding AJs headsup, you will get a different value ("2") than calling it against 9 opponents ("3").
Protected methodHasPair
Determines whether if your pocketcards are a pair.
Protected methodIsBridgePaired
Helper function, which determines whether there is at least 1 pair on the bridge.
Protected methodIsBridgeSuited
Helper function, which determines whether all cards on the bridge are of the same suit.
Protected methodMakeAllInDecision
Use this method if you want to go allin. This might be a bet/raise or a call.
Protected methodMakeFlopDecision
Override this member and return your decision on the flop.
Protected methodMakePreflopDecision
Override this member and return your decision preflop.
Protected methodMakeRaiseDecision
Helper function to return a correct decision if you want to bet/raise with a certain variance.
Protected methodMakeRiverDecision
Override this member and return your decision on the river.
Protected methodMakeTurnDecision
Override this member and return your decision on the turn.
Protected methodMaybeDoABluff
Helper function if you want to bluff (check/call or bet/raise) with a ceratin probability.
Protected methodNrMostBridgeColor
Helper function to calculate the maximum number of cards on the bridge, who have the same suit.
Protected methodPocketcards
Returns the 2 pocketcards you got dealt.
Protected methodRaise
Use this method if you want to bet/raise.
Protected methodResultPercent
Returns the percentages (0-100) for you to win, tie or lose the current hand, if there would be a showndown immediately. The results are based on simulation preflop (not 100% precise) and on calculation otherwise (100% precise).
Protected methodThreeOfAKindCheck
Returns how many of the 3 cards that make the three of a kind your player has in his hand. If method is called without your player having a three of a kind hand, -1 is returned. This is also true if yor player e.g. has a four of kind hand.
Protected methodTwoPairsCheck
Examines and returns information about the 2 pairs hand that you have. Examines and returns information about the 2 pairs hand that you have.
Top
See Also