maverick.protocol.PlayerLike#
- class maverick.protocol.PlayerLike(*args, **kwargs)[source]#
Protocol defining the interface for a valid player implementation.
Any class implementing this protocol can participate in a Texas Hold’em game. Custom player classes must implement all methods defined in this protocol.
- state#
Current player state containing seat, stack, holding, bets, etc.
- Type:
Optional[PlayerState]
- __init__(*args, **kwargs)#
Methods
__init__(*args, **kwargs)decide_action(*, game, valid_actions, ...)Decide what action to take given the current game state.
to_dict()Serialize the player to a dictionary representation.
Attributes
- decide_action(*, game: Game, valid_actions: list[ActionType], min_raise_amount: int, call_amount: int, min_bet_amount: int) PlayerAction[source]#
Decide what action to take given the current game state.
- Parameters:
game (Game) – The game instance containing the current state.
valid_actions (list[ActionType]) – List of valid actions the player can take.
min_raise_amount (int) – Minimum extra chips this player must add right now to complete a minimum raise.
call_amount (int) – Amount of chips this player must add right now to call the current bet.
min_bet_amount (int) – Minimum chips this player must add right now to make a bet.
- Returns:
An instance of PlayerAction representing the chosen action.
- Return type: