net.sf.freecol.server.control
Class PreGameController
java.lang.Object
net.sf.freecol.server.control.FreeColServerHolder
net.sf.freecol.server.control.Controller
net.sf.freecol.server.control.PreGameController
public final class PreGameController
- extends Controller
The control object that is responsible for setting parameters and starting a
new game. PreGameInputHandler
is used to receive and handle network
messages from the clients.
The game enters the state
FreeColServer.GameState.IN_GAME
, when the
startGame()
has successfully been invoked.
- See Also:
InGameInputHandler
Method Summary |
void |
sendUpdatedGame()
Sets the map and sends an updated Game -object (that
includes the map) to the clients. |
void |
startGame()
Updates and starts the game. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PreGameController
public PreGameController(FreeColServer freeColServer)
- The constructor to use.
- Parameters:
freeColServer
- The main server object.
startGame
public void startGame()
throws FreeColException
- Updates and starts the game.
This method performs these tasks in the given order:
- Generates the map.
- Sends updated game information to the clients.
- Changes the game state to
FreeColServer.GameState.IN_GAME
.
- Sends the "startGame"-message to the clients.
- Throws:
FreeColException
sendUpdatedGame
public void sendUpdatedGame()
- Sets the map and sends an updated
Game
-object (that
includes the map) to the clients.