net.sf.freecol.client.control
Class PreGameController

java.lang.Object
  extended by net.sf.freecol.client.control.PreGameController

public final class PreGameController
extends java.lang.Object

The controller that will be used before the game starts.


Constructor Summary
PreGameController(FreeColClient freeColClient)
          The constructor to use.
 
Method Summary
 void chat(java.lang.String message)
          Sends a chat message.
 MapGeneratorOptions getMapGeneratorOptions()
          Gets the MapGeneratorOptions used when creating a map.
 void requestLaunch()
          Requests the game to be started.
 void sendGameOptions()
          Sends the GameOptions to the server.
 void sendMapGeneratorOptions()
          Sends the MapGeneratorOptions to the server.
 void setAvailable(Nation nation, NationOptions.NationState state)
           
 void setColor(java.awt.Color color)
          Sets this client's player's color.
 void setNation(Nation nation)
          Sets this client's player's nation.
 void setNationType(NationType nationType)
          Sets this client's player's nation type.
 void setReady(boolean ready)
          Sets this client to be (or not be) ready to start the game.
 void startGame()
          Starts the game.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreGameController

public PreGameController(FreeColClient freeColClient)
The constructor to use.

Parameters:
freeColClient - The main controller.
Method Detail

getMapGeneratorOptions

public MapGeneratorOptions getMapGeneratorOptions()
Gets the MapGeneratorOptions used when creating a map.

Returns:
The MapGeneratorOptions.

setReady

public void setReady(boolean ready)
Sets this client to be (or not be) ready to start the game.

Parameters:
ready - Indicates wether or not this client is ready to start the game.

setNation

public void setNation(Nation nation)
Sets this client's player's nation.

Parameters:
nation - Which nation this player wishes to set.

setNationType

public void setNationType(NationType nationType)
Sets this client's player's nation type.

Parameters:
nationType - Which nation this player wishes to set.

setColor

public void setColor(java.awt.Color color)
Sets this client's player's color.

Parameters:
color - Which color this player wishes to set.

setAvailable

public void setAvailable(Nation nation,
                         NationOptions.NationState state)

requestLaunch

public void requestLaunch()
Requests the game to be started. This will only be successful if all players are ready to start the game.


chat

public void chat(java.lang.String message)
Sends a chat message.

Parameters:
message - The text of the message.

sendGameOptions

public void sendGameOptions()
Sends the GameOptions to the server. This method should be called after updating that object.


sendMapGeneratorOptions

public void sendMapGeneratorOptions()
Sends the MapGeneratorOptions to the server. This method should be called after updating that object.


startGame

public void startGame()
Starts the game.