uk.org.redfelineninja.risk.client
Class RiskClient

java.lang.Object
  |
  +--uk.org.redfelineninja.risk.client.RiskClient
All Implemented Interfaces:
RiskClientInterface

public class RiskClient
extends java.lang.Object
implements RiskClientInterface

This class provide a means to the start the client. In addition to bootstrapping the client this class aslo provides communication functions. This class as called by the network sub-system to perform all actions on the client. In addition it provides ActionListeners to communicate user actions to the server.

Status: ActionListeners are not yet implemented.


Constructor Summary
RiskClient()
          Start the application version of the Risk client.
 
Method Summary
 void gameOver(Player player)
          Called when the game is won.
 void gameOver(Player player, java.lang.String reason)
          Called when the game is stopped by the server.
 void gameStarting(Player[] players)
           
 RiskCardFrame getCardFrame()
           
 RiskClientFrame getMainFrame()
           
 RiskServerInterface getServer()
           
 RiskTalkerFrame getTalkerFrame()
           
 RiskWaitingFrame getWaitingFrame()
           
 void lostPlayer(Player player)
          Player loss is handled purely at the server.
static void main(java.lang.String[] args)
          Starting point for the application version.
 void message(java.lang.String message)
          Message sent over the chat system to all clients.
 void message(java.lang.String message, Player player)
           
 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)
          Spectator interaction is not yet supported.
 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)
          Die displays are not yet implemented in this interface.
 void setOwner(java.lang.String country, Player player)
          Set the owner of the country to the player.
 void setTurn(Player player)
          Moves the turn bar so that the supplied player is at the top
 void showStatus(java.lang.String status)
          Display the supplied string in the clients status line.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RiskClient

public RiskClient()
Start the application version of the Risk client.

Method Detail

main

public static void main(java.lang.String[] args)
Starting point for the application version. This method is responsible for creating all the major frames for this Risk client.


getMainFrame

public RiskClientFrame getMainFrame()

getWaitingFrame

public RiskWaitingFrame getWaitingFrame()

getTalkerFrame

public RiskTalkerFrame getTalkerFrame()

getCardFrame

public RiskCardFrame getCardFrame()

getServer

public RiskServerInterface getServer()

gameStarting

public void gameStarting(Player[] players)

newPlayer

public void newPlayer(Player player)
Description copied from interface: RiskClientInterface
Called when a new player has joined the game the client is waiting to play

Specified by:
newPlayer in interface RiskClientInterface

newSpectator

public void newSpectator(Player player)
Spectator interaction is not yet supported. This function is provided only for compatability.

Specified by:
newSpectator in interface RiskClientInterface

lostPlayer

public void lostPlayer(Player player)
Player loss is handled purely at the server. This function is provided for compatability.

Specified by:
lostPlayer in interface RiskClientInterface

newGame

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

Specified by:
newGame in interface RiskClientInterface

gameOver

public void gameOver(Player player)
Description copied from interface: RiskClientInterface
Called when the game is won.

Specified by:
gameOver in interface RiskClientInterface

gameOver

public void gameOver(Player player,
                     java.lang.String reason)
Description copied from interface: RiskClientInterface
Called when the game is stopped by the server.

Specified by:
gameOver in interface RiskClientInterface

message

public void message(java.lang.String message)
Description copied from interface: RiskClientInterface
Message sent over the chat system to all clients.

Specified by:
message in interface RiskClientInterface

message

public void message(java.lang.String message,
                    Player player)

setTurn

public void setTurn(Player player)
Moves the turn bar so that the supplied player is at the top

Specified by:
setTurn in interface RiskClientInterface

setArmies

public void setArmies(java.lang.String country,
                      int a)
Description copied from interface: RiskClientInterface
Set the number of armies in a country.

Specified by:
setArmies in interface RiskClientInterface

setOwner

public void setOwner(java.lang.String country,
                     Player player)
Description copied from interface: RiskClientInterface
Set the owner of the country to the player.

Specified by:
setOwner in interface RiskClientInterface

select

public void select(java.lang.String country)
Description copied from interface: RiskClientInterface
Select the supplied country.

Specified by:
select in interface RiskClientInterface

showStatus

public void showStatus(java.lang.String status)
Description copied from interface: RiskClientInterface
Display the supplied string in the clients status line.

Specified by:
showStatus in interface RiskClientInterface

setDice

public void setDice(int[] die)
Die displays are not yet implemented in this interface. This function is provided only for compatibilty.

Specified by:
setDice in interface RiskClientInterface

setCards

public void setCards(Card[] cards)
Description copied from interface: RiskClientInterface
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.

Specified by:
setCards in interface RiskClientInterface