rlcard.games.leducholdem

rlcard.games.leducholdem.dealer

class rlcard.games.leducholdem.dealer.LeducholdemDealer

Bases: rlcard.games.limitholdem.dealer.LimitholdemDealer

rlcard.games.leducholdem.game

class rlcard.games.leducholdem.game.LeducholdemGame(allow_step_back=False)

Bases: rlcard.games.limitholdem.game.LimitholdemGame

get_payoffs()

Return the payoffs of the game

Returns

Each entry corresponds to the payoff of one player

Return type

(list)

get_state(player)

Return player’s state

Parameters

player_id (int) – player id

Returns

The state of the player

Return type

(dict)

init_game()

Initialilze the game of Limit Texas Hold’em

This version supports two-player limit texas hold’em

Returns

Tuple containing:

(dict): The first state of the game (int): Current player’s id

Return type

(tuple)

is_over()

Check if the game is over

Returns

True if the game is over

Return type

(boolean)

step(action)

Get the next state

Parameters

action (str) – a specific action. (call, raise, fold, or check)

Returns

Tuple containing:

(dict): next player’s state (int): next plater’s id

Return type

(tuple)

step_back()

Return to the previous state of the game

Returns

True if the game steps back successfully

Return type

(bool)

rlcard.games.leducholdem.judger

class rlcard.games.leducholdem.judger.LeducholdemJudger

Bases: object

The Judger class for Leduc Hold’em

static judge_game(players, public_card)

Judge the winner of the game.

Parameters
  • players (list) – The list of players who play the game

  • public_card (object) – The public card that seen by all the players

Returns

Each entry of the list corresponds to one entry of the

Return type

(list)

rlcard.games.leducholdem.player

class rlcard.games.leducholdem.player.LeducholdemPlayer(player_id)

Bases: object

get_player_id()

Return the id of the player

get_state(public_card, all_chips, legal_actions)

Encode the state for the player

Parameters
  • public_card (object) – The public card that seen by all the players

  • all_chips (int) – The chips that all players have put in

Returns

The state of the player

Return type

(dict)

rlcard.games.leducholdem.round

Implement Leduc Hold’em Round class

class rlcard.games.leducholdem.round.LeducholdemRound(raise_amount, allowed_raise_num, num_players)

Bases: rlcard.games.limitholdem.round.LimitholdemRound

Round can call other Classes’ functions to keep the game running