public class GamingPlattform
extends java.lang.Object
| Constructor and Description |
|---|
GamingPlattform(NetworkConnectorForServer server,
DataStorage data)
the constructor were you have to reference the server on which you are
running
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAClient(WarriorServerThread client)
if a new player wants to join a game call this method
|
void |
archive()
archives this game
|
java.util.ArrayList<java.lang.Integer> |
getCoreData() |
DataStorage |
getDataStorage() |
java.lang.String |
getFinishMassage()
if the game has been computed you can get the finish message that you can send to a client
or it is "" if no computation has been done
|
java.lang.Integer |
getGameCounter() |
java.lang.Integer |
getGameLaps()
that often a game is played against the same enemy
|
java.util.ArrayList<java.lang.String> |
getPlayerNames() |
java.util.ArrayList<WarriorServerThread> |
getPlayers() |
java.util.Queue<CoreChange> |
getQueue() |
WarriorServerThread |
getWinner() |
java.lang.Boolean |
isItADraw()
if it was a draw
|
java.lang.Boolean |
isThereAFreeSlot() |
void |
itIsADraw()
if it is a draw call this method
|
void |
renderGame(java.util.ArrayList<Warrior> warriors,
java.util.Queue<CoreChange> queue)
This computes the game whith the code you sent and writes it into the Queue you gives it to
|
void |
setCoreData()
This method updates the core data when you rendered the game already
|
void |
setCoreData(java.util.ArrayList<java.lang.Integer> core)
sets up the first frame if you know the coreData, if not use the
setCoreData() method. |
void |
setGameLaps(java.lang.Integer laps)
How often do you want to play?
|
void |
setNextCoreChange(CoreChange change)
if a new Frame is available set it up whith this method
|
void |
setQueue(java.util.LinkedList<CoreChange> queue)
sets up a new Frame Queue
|
void |
setVisitor(WarriorServerThread visitor)
reference a new visitor
|
void |
setWinner()
and if you want to update the winner call this function
|
void |
setWinner(java.util.ArrayList<WarriorServerThread> players)
if you want to set up the winner through the progress with a reference to
a list of players
|
void |
setWinner(WarriorServerThread client)
if you want to set up an client that you know as the winner
|
public GamingPlattform(NetworkConnectorForServer server, DataStorage data)
server - has to be the server you are running ondata - has to be the model of the clientControlerpublic void setWinner(WarriorServerThread client)
client - public void setWinner(java.util.ArrayList<WarriorServerThread> players)
players - public void setWinner()
public void setCoreData(java.util.ArrayList<java.lang.Integer> core)
setCoreData() method.core - public void setCoreData()
public void setQueue(java.util.LinkedList<CoreChange> queue)
queue - public void setGameLaps(java.lang.Integer laps)
laps - public void setVisitor(WarriorServerThread visitor)
visitor - public void setNextCoreChange(CoreChange change)
change - public java.lang.Integer getGameLaps()
public java.util.Queue<CoreChange> getQueue()
public java.util.ArrayList<java.lang.Integer> getCoreData()
public void addAClient(WarriorServerThread client)
client - public WarriorServerThread getWinner()
public java.util.ArrayList<WarriorServerThread> getPlayers()
public java.util.ArrayList<java.lang.String> getPlayerNames()
public java.lang.Integer getGameCounter()
public java.lang.Boolean isItADraw()
public void itIsADraw()
public java.lang.String getFinishMassage()
public DataStorage getDataStorage()
public void renderGame(java.util.ArrayList<Warrior> warriors, java.util.Queue<CoreChange> queue)
warriors - has to be the code of the playersqueue - is called by referencepublic java.lang.Boolean isThereAFreeSlot()
public void archive()