|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
simulations.core.Judge
public class Judge
This class describes the judge of the game (the mediator)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Judge(Game game)
Creates a new instance of Judge |
Method Summary | |
---|---|
void |
addToGraph()
Add the last list of players to the playerListList to construct graph |
double[] |
coalitionListToData(java.util.ArrayList l)
Returns a array of double that represents the data of l |
PlayerTurn |
doAttack(Player attackingPlayer,
Player playerToAttack,
java.util.ArrayList playersToAskSupport)
Do an attack when all parameters are set. |
void |
endGame()
end the game |
void |
endTurn()
validate the end of a turn. |
java.util.ArrayList |
getClassement()
Getter for property classement. |
java.util.ArrayList |
getCloneRemainingPlayers()
Returns (aclone) of the list of remaining players |
java.util.ArrayList |
getCoalitionListList()
Getter for property coalitionListList. |
java.util.Hashtable |
getCoalitionsRanking()
Getter for property coalitionsRanking. |
CoalitionView |
getCoalitionView()
Getter for property coalitionView. |
int |
getCurrentTurn()
Getter for property currentTurn. |
Game |
getGame()
Getter for property game. |
HistoryWriter |
getHistoryWriter()
Getter for property historyWriter. |
java.util.ArrayList |
getPlayerListList()
Getter for property playerListList. |
java.util.ArrayList |
getStatisticsList()
Getter for property statisticsList. |
java.lang.String |
getTurnDescription()
Getter for property turnDescription. |
void |
initGame()
init the game : creates list instance, memorize time, etc... |
boolean |
isInClassement(Player p)
This method returns true if the player p is already dead and he's already in classement |
boolean |
nextGameTurn()
return true if game is finish because the three last turn are the same false otherwise |
Turn |
nextTurn()
playing next turn of the game. |
boolean |
playGame()
launch the game |
Turn |
returnLastTurn()
This method returns the last turn of the game. |
void |
run()
This method is overiden from Thread. |
void |
setClassement(java.util.ArrayList classement)
Setter for property classement. |
void |
setCoalitionListList(java.util.ArrayList coalitionListList)
Setter for property coalitionListList. |
void |
setCoalitionsRanking(java.util.Hashtable coalitionsRanking)
Setter for property coalitionsRanking. |
void |
setCoalitionView(CoalitionView coalitionView)
Setter for property coalitionView. |
void |
setCurrentTurn(int currentTurn)
Setter for property currentTurn. |
void |
setGame(Game game)
Setter for property game. |
void |
setHistoryWriter(HistoryWriter historyWriter)
Setter for property historyWriter. |
void |
setPlayerListList(java.util.ArrayList playerListList)
Setter for property playerListList. |
void |
setStatisticsList(java.util.ArrayList statisticsList)
Setter for property statisticsList. |
void |
setTurnDescription(java.lang.String turnDescription)
Setter for property turnDescription. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Judge(Game game)
game
- The game that the judge will manage.Method Detail |
---|
public void initGame()
public boolean nextGameTurn()
public double[] coalitionListToData(java.util.ArrayList l)
l
- The list of coalition list
public void endGame()
public boolean playGame()
public Turn returnLastTurn()
public java.util.ArrayList getCloneRemainingPlayers()
public void addToGraph()
public Turn nextTurn()
public boolean isInClassement(Player p)
p
- The player
public void endTurn()
public PlayerTurn doAttack(Player attackingPlayer, Player playerToAttack, java.util.ArrayList playersToAskSupport)
attackingPlayer
- The attacking playerplayerToAttack
- The attacked playerplayersToAskSupport
- The players to ask support.
public Game getGame()
public void setGame(Game game)
game
- New value of property game.public int getCurrentTurn()
public void setCurrentTurn(int currentTurn)
currentTurn
- New value of property currentTurn.public HistoryWriter getHistoryWriter()
public void setHistoryWriter(HistoryWriter historyWriter)
historyWriter
- New value of property historyWriter.public java.util.ArrayList getPlayerListList()
public void setPlayerListList(java.util.ArrayList playerListList)
playerListList
- New value of property playerListList.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public CoalitionView getCoalitionView()
public void setCoalitionView(CoalitionView coalitionView)
coalitionView
- New value of property coalitionView.public java.util.ArrayList getStatisticsList()
public void setStatisticsList(java.util.ArrayList statisticsList)
statisticsList
- New value of property statisticsList.public java.lang.String getTurnDescription()
public void setTurnDescription(java.lang.String turnDescription)
turnDescription
- New value of property turnDescription.public java.util.ArrayList getClassement()
public void setClassement(java.util.ArrayList classement)
classement
- New value of property classement.public java.util.ArrayList getCoalitionListList()
public void setCoalitionListList(java.util.ArrayList coalitionListList)
coalitionListList
- New value of property coalitionListList.public java.util.Hashtable getCoalitionsRanking()
public void setCoalitionsRanking(java.util.Hashtable coalitionsRanking)
coalitionsRanking
- New value of property coalitionsRanking.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |