|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.Writer | +--java.io.PrintWriter | +--uk.org.redfelineninja.risk.server.RiskClientWriter
This class provides the network output hooks required by the server. The RiskServerInterface proved to be insufficient so we have extended from writer as well.
Constructor Summary | |
RiskClientWriter(java.io.Writer network,
java.util.Hashtable pR)
|
Method Summary | |
void |
error(java.lang.String err)
Report an error only to the active player. |
void |
gameOver(Player victor)
Called when the game is won. |
void |
gameOver(Player player,
java.lang.String reason)
Called when the game is stopped by the server. |
void |
lostPlayer(Player player)
Called when a player leaves the game (or if his connection is timed out). |
void |
message(java.lang.String message)
Message sent over the chat system to all clients. |
void |
newGame(Player[] players)
Called when the games owner decides to stop waiting for new players and start playing. |
void |
newPlayer(Player player)
Called when a new player has joined the game the client is waiting to play |
void |
newSpectator(Player player)
Called whenever a new spectator has joined the game. |
void |
select(java.lang.String country)
Set the selection to the country. |
void |
setArmies(java.lang.String country,
int a)
Set the number of armies in a country. |
void |
setCards(Card[] cards)
Tell the client the cards that the player has. |
void |
setDice(int[] die)
Supply the current state of the dice to those it interests. |
void |
setOwner(java.lang.String country,
Player player)
Set the owner of the country to the player. |
void |
setTurn(Player player)
It is player's turn |
void |
showStatus(java.lang.String status)
Display the supplied string in the clients status line. |
Methods inherited from class java.io.PrintWriter |
checkError, close, flush, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, println, write, write, write, write, write |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RiskClientWriter(java.io.Writer network, java.util.Hashtable pR)
Method Detail |
public void error(java.lang.String err)
public void newPlayer(Player player)
newPlayer
in interface RiskClientInterface
public void newSpectator(Player player)
newSpectator
in interface RiskClientInterface
public void lostPlayer(Player player)
lostPlayer
in interface RiskClientInterface
public void newGame(Player[] players)
newGame
in interface RiskClientInterface
public void gameOver(Player victor)
gameOver
in interface RiskClientInterface
public void gameOver(Player player, java.lang.String reason)
gameOver
in interface RiskClientInterface
public void message(java.lang.String message)
message
in interface RiskClientInterface
public void setTurn(Player player)
setTurn
in interface RiskClientInterface
public void showStatus(java.lang.String status)
showStatus
in interface RiskClientInterface
public void setArmies(java.lang.String country, int a)
setArmies
in interface RiskClientInterface
public void setOwner(java.lang.String country, Player player)
setOwner
in interface RiskClientInterface
public void select(java.lang.String country)
select
in interface RiskClientInterface
public void setDice(int[] die)
setDice
in interface RiskClientInterface
public void setCards(Card[] cards)
setCards
in interface RiskClientInterface
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |