com.asdf.plugins.pokergames
Class OurPlayer

java.lang.Object
  extended by com.asdf.plugins.pokergames.OurPlayer
All Implemented Interfaces:
Player

public class OurPlayer
extends java.lang.Object
implements Player

class implementing Player interface for human players to send action choices through

Author:
rimpila

Constructor Summary
OurPlayer(java.lang.String name, int mySeat, PokerGameController gameController)
           
 
Method Summary
 void actionEvent(int pos, Action action)
           
 void dealHoleCardsEvent()
          From GameObserver, called when hole cards are dealt.
 void gameOverEvent()
          Called when the hand is over.
 void gameStartEvent(GameInfo arg0, int seat)
           
 void gameStateChanged()
          From GameObserver, called whenever an action is completed, and the GameModel has been updated
 Action getAction()
           
 GameController getGameController()
           
 Hand getHand()
           
static void main(java.lang.String[] args)
           
 void receiveHand(Hand hand, int seat)
          Receive your hand, and your seat, this is called when the player is dealt his hand
 void setGameController(PokerGameController gameController)
           
 void showdownEvent(int pos, Card c1, Card c2)
          from GameObserver, Player pos has shown two cards.
 void stageEvent(int arg0)
          a new stage has begun.
 void winEvent(int seat, double amount, Hand hand)
          from GameObserver, a player at seat has won amount
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OurPlayer

public OurPlayer(java.lang.String name,
                 int mySeat,
                 PokerGameController gameController)
Method Detail

setGameController

public void setGameController(PokerGameController gameController)

getGameController

public GameController getGameController()

getHand

public Hand getHand()

actionEvent

public void actionEvent(int pos,
                        Action action)
Specified by:
actionEvent in interface Player
Parameters:
pos - (int) the position of the player who made the action
action - (Action) the action made This should be called when any one makes an action

dealHoleCardsEvent

public void dealHoleCardsEvent()
Description copied from interface: Player
From GameObserver, called when hole cards are dealt.

Specified by:
dealHoleCardsEvent in interface Player

gameOverEvent

public void gameOverEvent()
Description copied from interface: Player
Called when the hand is over.

Specified by:
gameOverEvent in interface Player

gameStartEvent

public void gameStartEvent(GameInfo arg0,
                           int seat)
Specified by:
gameStartEvent in interface Player
Parameters:
arg0 - (GameInfo) all the public information of the starting hand (i.e. our GameModel object) Called at the start of hand.

gameStateChanged

public void gameStateChanged()
Description copied from interface: Player
From GameObserver, called whenever an action is completed, and the GameModel has been updated

Specified by:
gameStateChanged in interface Player

getAction

public Action getAction()
Specified by:
getAction in interface Player
Returns:
Action the players next action, with desired amount This is called when it is the players turn to act.

receiveHand

public void receiveHand(Hand hand,
                        int seat)
Description copied from interface: Player
Receive your hand, and your seat, this is called when the player is dealt his hand

Specified by:
receiveHand in interface Player
seat - your seat in this round

showdownEvent

public void showdownEvent(int pos,
                          Card c1,
                          Card c2)
Description copied from interface: Player
from GameObserver, Player pos has shown two cards.

Specified by:
showdownEvent in interface Player
Parameters:
pos - the showing player
c1 - first card
c2 - second shown card

stageEvent

public void stageEvent(int arg0)
Description copied from interface: Player
a new stage has begun. A player may override this method to receive the event for texas hold'em the stage is a constant from TexasHoldemEnumStage

Specified by:
stageEvent in interface Player

winEvent

public void winEvent(int seat,
                     double amount,
                     Hand hand)
Description copied from interface: Player
from GameObserver, a player at seat has won amount

Specified by:
winEvent in interface Player
Parameters:
seat - the player
amount - the amount won

main

public static void main(java.lang.String[] args)