poker
Class Pot

java.lang.Object
  extended by poker.Pot
All Implemented Interfaces:
java.io.Serializable

public class Pot
extends java.lang.Object
implements java.io.Serializable

Handles a Pot data structure, which accumulates money from players, and can break into multiple side pots.

Author:
adavidson
See Also:
Serialized Form

Constructor Summary
Pot(GameInfo gi)
           
Pot(Pot p)
          Copy constructor
 
Method Summary
 int getNumPots()
           
 Pot[] getPots()
           
 Pot getSidePot()
           
 double getSize()
           
 double getThreshold()
           
 boolean hasSidePot()
           
 void payPot(double amount, PlayerInfo pi)
           
 double removeUncalledChips()
          Remove all uncalled chips from the pot
 double removeUncalledChips(Pot p)
          Remove all uncalled chips from the pot
 void setGameInfo(GameInfo gInfo)
           
 void setThreshold(double t)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pot

public Pot(GameInfo gi)

Pot

public Pot(Pot p)
Copy constructor

Parameters:
p - the pot to deep copy.
Method Detail

setGameInfo

public void setGameInfo(GameInfo gInfo)

payPot

public void payPot(double amount,
                   PlayerInfo pi)

getSidePot

public Pot getSidePot()

setThreshold

public void setThreshold(double t)

getThreshold

public double getThreshold()

getSize

public double getSize()

getPots

public Pot[] getPots()

getNumPots

public int getNumPots()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hasSidePot

public boolean hasSidePot()
Returns:
true if there is a side pot

removeUncalledChips

public double removeUncalledChips()
Remove all uncalled chips from the pot

Returns:
the amount removed from the pot.

removeUncalledChips

public double removeUncalledChips(Pot p)
Remove all uncalled chips from the pot

Returns:
the amount removed from the pot.