uk.org.redfelineninja.risk.net
Interface RiskClientInterface

All Known Implementing Classes:
GameState, RiskClient, RiskClientWriter

public interface RiskClientInterface

This interface provides a common means to control any Risk client whether it be the graphical client or a robot player. Only asyncronous action are listed in this interface. Information that would be better modeled as methods return values are modeled as such and this is handled by the Network sub-system.

Author:
Daniel Thompson, Jan 1999

Method Summary
 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)
          Select the supplied 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.
 

Method Detail

newPlayer

public void newPlayer(Player player)
Called when a new player has joined the game the client is waiting to play


newSpectator

public void newSpectator(Player player)
Called whenever a new spectator has joined the game. This can be ignored unless the client has a talker that supports private talking. Robots could communicate their internal state like this if desired.


lostPlayer

public void lostPlayer(Player player)
Called when a player leaves the game (or if his connection is timed out). Leaving mid-game is anti-social but it will happen.


newGame

public void newGame(Player[] players)
Called when the games owner decides to stop waiting for new players and start playing.


gameOver

public void gameOver(Player victor)
Called when the game is won.


gameOver

public void gameOver(Player player,
                     java.lang.String reason)
Called when the game is stopped by the server.


message

public void message(java.lang.String message)
Message sent over the chat system to all clients.


setTurn

public void setTurn(Player player)
It is player's turn


showStatus

public void showStatus(java.lang.String status)
Display the supplied string in the clients status line.


setArmies

public void setArmies(java.lang.String country,
                      int a)
Set the number of armies in a country.


setOwner

public void setOwner(java.lang.String country,
                     Player player)
Set the owner of the country to the player.


select

public void select(java.lang.String country)
Select the supplied country.


setDice

public void setDice(int[] die)
Supply the current state of the dice to those it interests.


setCards

public void setCards(Card[] cards)
Tell the client the cards that the player has. Clients can connect to the server with two connections if there are two players at that client.