ca.ualberta.cs.poker.free.client
Class ClientPokerDynamics

java.lang.Object
  extended by ca.ualberta.cs.poker.free.dynamics.PokerDynamics
      extended by ca.ualberta.cs.poker.free.client.ClientPokerDynamics

public class ClientPokerDynamics
extends PokerDynamics

Maintains a version of the server's state on the client side. Keeps track of bankroll, seat, and the state of the match in a usable form.


Field Summary
 double bankroll
          The bankroll at the beginning of the hand when (handOver==false): when (handOver==true), it becomes the bankroll at the end of the hand.
 int seatTaken
          The seat taken by this player.
 
Fields inherited from class ca.ualberta.cs.poker.free.dynamics.PokerDynamics
amountWon, bettingSequence, board, firstActionOnRound, handNumber, handOver, hole, inPot, roundBets, roundIndex, seatToAct, winnerIndex
 
Constructor Summary
ClientPokerDynamics()
          Creates a new instance of ClientPokerDynamics
 
Method Summary
 Card getCard(java.lang.String cardSequence, int currentIndex)
          Get a card from the card sequence.
 java.lang.String getRoundBettingSequence()
          Returns the betting sequence since the last cards observed.
 boolean isOurTurn()
          Returns true if it is our turn to act.
 void setBettingString(java.lang.String bettingString)
          Initialize the betting string.
 void setCards(java.lang.String cardSequence)
          Initialize all the cards from the card sequence.
 void setFromMatchStateMessage(java.lang.String message)
          Initialize this from a match state message.
 void updateBankroll()
          Update the bankroll: note that this is ONLY changed at the end of a hand.
 
Methods inherited from class ca.ualberta.cs.poker.free.dynamics.PokerDynamics
addToPot, dealCards, endHand, getCardState, getMatchState, getOtherSeat, getWinner, handleAction, handleCall, handleFold, handleRaise, incrementRound, initializeBets, isFirstSeatVisible, isSecondSeatVisible, setHandNumber, startHand, startHand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

seatTaken

public int seatTaken
The seat taken by this player.


bankroll

public double bankroll
The bankroll at the beginning of the hand when (handOver==false): when (handOver==true), it becomes the bankroll at the end of the hand.

Constructor Detail

ClientPokerDynamics

public ClientPokerDynamics()
Creates a new instance of ClientPokerDynamics

Method Detail

isOurTurn

public boolean isOurTurn()
Returns true if it is our turn to act.


setFromMatchStateMessage

public void setFromMatchStateMessage(java.lang.String message)
Initialize this from a match state message.


setBettingString

public void setBettingString(java.lang.String bettingString)
Initialize the betting string.


getCard

public Card getCard(java.lang.String cardSequence,
                    int currentIndex)
Get a card from the card sequence.


setCards

public void setCards(java.lang.String cardSequence)
Initialize all the cards from the card sequence. Unknown cards are null pointers.


getRoundBettingSequence

public java.lang.String getRoundBettingSequence()
Returns the betting sequence since the last cards observed.


updateBankroll

public void updateBankroll()
Update the bankroll: note that this is ONLY changed at the end of a hand.