poker
Interface Player

All Superinterfaces:
GameObserver

public interface Player
extends GameObserver

An interface for a poker player.

Version:
1.2.0
Author:
Aaron Davidson

Method Summary
 int action()
          Requests an action from the player (FOLD, CALL, RAISE) RAISE_NL(amount) in a no-limit game as a special case.
 void actionEvent(int pos, int action, int amount)
          A player can override this method to recieve events for each action made by a player.
 void gameOverEvent()
          The hand is now over.
 void gameStartEvent(GameInfo gi)
          The hand is starting
 void init(Preferences prefs)
          Initialize your player from the given preferences file.
 void newGame(GameInfo gInfo, Card c1, Card c2, int ID)
          Start playing a new game.
 void showdownEvent(int pos, Card c1, Card c2)
          Player pos has shown two cards.
 void stageEvent(int stage)
          A new stage (betting round) has begun.
 void winEvent(int pos, int amount, java.lang.String handName)
          A player at pos has won amount with the hand handName
 

Method Detail

init

void init(Preferences prefs)
Initialize your player from the given preferences file.

Parameters:
prefs - some settings for the player

newGame

void newGame(GameInfo gInfo,
             Card c1,
             Card c2,
             int ID)
Start playing a new game.

Parameters:
gInfo - the new game information
c1 - first hole card
c2 - second hole card
ID - your player ID for this game (position from the button)

actionEvent

void actionEvent(int pos,
                 int action,
                 int amount)
A player can override this method to recieve events for each action made by a player.

Specified by:
actionEvent in interface GameObserver
Parameters:
pos - the player's position
action - the action made by the player
amount - an amount (called, raised, etc...) or 0 if not applicable

stageEvent

void stageEvent(int stage)
A new stage (betting round) has begun. A player may override this method to recieve the event

Specified by:
stageEvent in interface GameObserver
Parameters:
stage - the new stage ID

showdownEvent

void showdownEvent(int pos,
                   Card c1,
                   Card c2)
Player pos has shown two cards.

Specified by:
showdownEvent in interface GameObserver
Parameters:
pos - the palyer showing cards
c1 - the player's first hole card
c2 - the player's second hole card

gameStartEvent

void gameStartEvent(GameInfo gi)
The hand is starting

Specified by:
gameStartEvent in interface GameObserver

gameOverEvent

void gameOverEvent()
The hand is now over.

Specified by:
gameOverEvent in interface GameObserver

winEvent

void winEvent(int pos,
              int amount,
              java.lang.String handName)
A player at pos has won amount with the hand handName

Specified by:
winEvent in interface GameObserver

action

int action()
Requests an action from the player (FOLD, CALL, RAISE) RAISE_NL(amount) in a no-limit game as a special case. Called when it is the Player's turn to act.