pokerthproto.game module

All functionality related to a poker game and its representation.

class pokerthproto.game.ActionInfo(player, kind, money=None)[source]

Bases: object

The action of a player during the poker game.

Parameters:
  • player – player (Player)
  • kind – type of the action (Action)
  • money – stake of the action if available
class pokerthproto.game.Game(gameId, myPlayerId)[source]

Bases: object

A poker game holding the information about the actions of the players.

addAction(playerId, kind, money=None)[source]

Adds an action to the current round of the game

Parameters:
  • playerId – id of player
  • kind – type of the action of Action
  • money – stake of the action if available
addOthersCards(playerId, cards)[source]
addPlayer(player)[source]
addRound(name, cards=None)[source]

Adds a poker round to the game

Parameters:
  • name – poker round of type Round
  • cards – board cards of the round
addWin(playerId, money)[source]
bigBlind
currRound
currRoundInfo

Current poker round

Returns:poker round
Return type:RoundInfo
dealer
delPlayer(player)[source]
existPlayer(id)[source]

Checks if a player exists in the game

Parameters:id – id of the player
Returns:test if player exists
existRound(name)[source]

Checks if the poker round exists in this game

Parameters:name – poker round of Round
Returns:test if round exists
gameId
getActions(playerId=None, rounds=None)[source]

Retrieves actions from the game with optional restrictions on rounds and a player.

Parameters:
  • playerId – id of the player or None for all players
  • rounds – list of rounds (Round) to consider
Returns:

list of actions (Actioninfo)

getPlayer(id)[source]

Retrieves a player from the game

Parameters:id – id of the player
Returns:player
handNum
highestSet
minimumRaise
myBet
othersCards
players
pocketCards
seats
smallBlind
startNewHand()[source]
wins
exception pokerthproto.game.GameError[source]

Bases: exceptions.Exception

class pokerthproto.game.RoundInfo(gameState, cards=None)[source]

Bases: object

Information about the poker round.

Parameters:
  • gameState – name of the poker round (Round)
  • cards – board card of the round as defined in deck
actions
cards
gameState
name