edu.umk.mat.merdacz.JGFramework
Class GameTable
java.lang.Object
edu.umk.mat.merdacz.JGFramework.GameTable
- public class GameTable
- extends java.lang.Object
Thread safe
- Author:
- Marcin Daczkowski
Constructor Summary |
GameTable(int maxPlayers)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
maxPlayers
int maxPlayers
table
java.util.HashMap table
lockTable
java.lang.Object lockTable
lockWinner
java.lang.Object lockWinner
winner
private Player winner
GameTable
public GameTable(int maxPlayers)
sitDown
public boolean sitDown(Player p)
standUp
public boolean standUp(Player p)
emptyPlaces
public int emptyPlaces()
isAllUnpaused
public boolean isAllUnpaused()
isAllReady
public boolean isAllReady()
isGameOver
public boolean isGameOver()
getWinner
public Player getWinner()
setDefeat
public void setDefeat(Player p)
isDefeat
public boolean isDefeat(Player p)
switchPause
public boolean switchPause(java.lang.String playerName)
setReady
public boolean setReady(java.lang.String playerName)
reset
public void reset()
- after we have winner we need to reset some values in out players HashMap
for example need to set all ready's to false etc
toXml
public java.lang.String toXml()
- Produces xml which contains all players sitting by the table
- Returns:
isByTable
private boolean isByTable(java.lang.String playerName)