|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectglassfrog.model.Gamestate
public class Gamestate
The Gamestate class handles all of the state information for a particular game at any given time. This class is constantly updated and accessed. It holds information pertinant to the actual game, not the individual players such as potsize, current bet, num bets, round number
Field Summary | |
---|---|
private java.lang.String |
actionString
|
private int |
button
|
private int |
currentBet
|
private boolean |
handOver
|
private int |
maxBet
|
private int |
minBet
|
private int |
numBets
|
private int |
potsize
|
private int |
round
|
Constructor Summary | |
---|---|
Gamestate()
Default constructor. |
Method Summary | |
---|---|
void |
addToActionString(java.lang.String action)
Add an action to the action string. |
void |
addToPot(int amount)
Add to the pot the amount given. |
java.lang.String |
getActionString()
Get the the string representation of the betting sequence |
int |
getButton()
Get the current position of the button |
int |
getCurrentBet()
Get the current bet size |
int |
getMaxBet()
Get the maximum bet of the game |
int |
getMinBet()
Get the minimum bet for the game |
int |
getNumBets()
Get the number of bets made so far in the game for the round |
int |
getPotsize()
Get the current potsize |
int |
getRound()
Get the current round |
boolean |
isHandOver()
Return whether or not the hand is over |
void |
makeBet(int betSize,
int lastCommited)
Have the game commit a bet of size betSize. |
void |
nextRound()
Increment the round by one. |
void |
setButton(int button)
Set the position of the button |
void |
setCurrentBet(int currentBet)
Set the current betsize |
void |
setHandOver(boolean handOver)
Sets whether the hand is over or not |
void |
setMaxBet(int maxBet)
Set the maximum bet of the game |
void |
setMinBet(int minBet)
Set the minimum bet for the game |
void |
setNumBets(int numBets)
Set the number of bets made so far in the game in this round |
void |
setPotsize(int potsize)
Set the potsize |
void |
setRound(int round)
Set the current round |
void |
subtractFromPot(int amount)
Subtract from the pot the amount given. |
java.lang.String |
toString()
A String representation of the gamestate... |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int potsize
private int minBet
private int maxBet
private int currentBet
private int round
private int numBets
private int button
private boolean handOver
private java.lang.String actionString
Constructor Detail |
---|
public Gamestate()
Method Detail |
---|
public int getButton()
public void setButton(int button)
button
- an int representing the position of the buttonpublic int getCurrentBet()
public void setCurrentBet(int currentBet)
currentBet
- an int representing the current betsizepublic boolean isHandOver()
public void setHandOver(boolean handOver)
handOver
- a boolean representing whether or not the hand is overpublic int getMaxBet()
public void setMaxBet(int maxBet)
maxBet
- an int representing the games max betpublic int getMinBet()
public void setMinBet(int minBet)
minBet
- an int representing the game's minimum betpublic int getNumBets()
public void setNumBets(int numBets)
numBets
- an int representing the number of bets made in the roundpublic int getPotsize()
public void setPotsize(int potsize)
potsize
- an int representing the potsize of the gamepublic int getRound()
public void setRound(int round)
round
- and int representing the current round of the gamepublic java.lang.String getActionString()
public void nextRound()
public void makeBet(int betSize, int lastCommited)
betSize
- an int representing the size of the bet to makelastCommited
- an int to make sure the current bet is how much the last
player had in the potpublic void addToPot(int amount)
amount
- An int amount to add to the potpublic void subtractFromPot(int amount)
amount
- The amount to subtract from the potsizepublic void addToActionString(java.lang.String action)
action
- a string representing what actions to add to the action stringpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |