|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.client.FreeColClient
public final class FreeColClient
The main control class for the FreeCol client. This class both starts and keeps references to the GUI and the control objects.
| Field Summary | |
|---|---|
private ActionManager |
actionManager
|
private Client |
client
The network Client that can be used to send messages to
the server. |
private ClientOptions |
clientOptions
|
private ConnectController |
connectController
|
private FreeColServer |
freeColServer
The server that has been started from the client-GUI. |
private Game |
game
|
private GUI |
gui
|
private boolean |
headless
Describe headless here. |
private boolean |
inGame
Indicates if the game has started, has nothing to do with whether or not the client is logged in. |
private InGameController |
inGameController
|
private InGameInputHandler |
inGameInputHandler
|
private boolean |
isRetired
|
private boolean |
loggedIn
Indicated whether or not there is an open connection to the server. |
private static java.util.logging.Logger |
logger
|
private boolean |
mapEditor
|
private MapEditorController |
mapEditorController
|
private Player |
player
The player "owning" this client. |
private PreGameController |
preGameController
|
private PreGameInputHandler |
preGameInputHandler
|
private ServerAPI |
serverAPI
|
private boolean |
singleplayer
|
Worker |
worker
|
| Constructor Summary | |
|---|---|
FreeColClient(java.io.File savedGame,
java.awt.Dimension size,
boolean sound,
java.lang.String splashFilename,
boolean showOpeningVideo,
java.lang.String fontName)
Creates a new FreeColClient. |
|
| Method Summary | |
|---|---|
ServerAPI |
askServer()
Meaningfully named access to the ServerAPI. |
void |
askToQuit()
Quits the application. |
boolean |
canSaveCurrentGame()
Verifies if this client can save the current game Clients that do not have the server running, or that have not the required permissions cannot save and should have the menu entry disabled |
void |
continuePlaying()
Continue playing after winning the game. |
boolean |
currentPlayerIsMyPlayer()
|
private void |
exitActions()
|
ActionManager |
getActionManager()
Gets the object responsible for keeping and updating the actions. |
Client |
getClient()
Gets the Client that can be used to send messages to the
server. |
ClientOptions |
getClientOptions()
Returns the object keeping the current client options. |
ConnectController |
getConnectController()
Gets the controller responsible for starting a server and connecting to it. |
FreeColServer |
getFreeColServer()
Gets the FreeColServer started by the client. |
Game |
getGame()
Gets the Game that we are currently playing. |
GUI |
getGUI()
|
InGameController |
getInGameController()
Gets the controller that will be used when the game has been started. |
InGameInputHandler |
getInGameInputHandler()
Gets the input handler that will be used when the game has been started. |
MapEditorController |
getMapEditorController()
|
Player |
getMyPlayer()
Gets the Player that uses this client. |
PreGameController |
getPreGameController()
Gets the controller that will be used before the game has been started. |
PreGameInputHandler |
getPreGameInputHandler()
Gets the input handler that will be used before the game has been started. |
boolean |
isAdmin()
Checks if this client is the game admin. |
boolean |
isHeadless()
Get the Headless value. |
boolean |
isInGame()
Checks if the game has started. |
boolean |
isLoggedIn()
Returns true if this client is logged in to a server or false otherwise. |
boolean |
isMapEditor()
|
boolean |
isSingleplayer()
Is the user playing in singleplayer mode. |
private void |
loadClientOptions(java.io.File savedGame)
Loads the client options. |
void |
newGame()
Displays a quit dialog and, if desired, logs out of the current game and shows the new game panel. |
void |
quit()
Quits the application without any questions. |
void |
retire()
Quits the application. |
void |
setClient(Client client)
Sets the Client that shall be used to send messages to the
server. |
void |
setFreeColServer(FreeColServer freeColServer)
Sets the FreeColServer which has been started by the
client gui. |
void |
setGame(Game game)
Sets the Game that we are currently playing. |
void |
setHeadless(boolean newHeadless)
Set the Headless value. |
void |
setInGame(boolean inGame)
Notifies this GUI that the game has started or ended. |
void |
setIsRetired(boolean isRetired)
Sets whether or not the user has retired the game. |
void |
setLoggedIn(boolean loggedIn)
Sets whether or not this client is logged in to a server. |
void |
setMapEditor(boolean mapEditor)
|
void |
setMyPlayer(Player player)
Sets the Player that uses this client. |
void |
setSingleplayer(boolean singleplayer)
Sets whether or not this game is a singleplayer game. |
void |
skipTurns(int turns)
Start the game skipping turns. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
private ConnectController connectController
private PreGameController preGameController
private PreGameInputHandler preGameInputHandler
private InGameController inGameController
private InGameInputHandler inGameInputHandler
private MapEditorController mapEditorController
private ServerAPI serverAPI
private GUI gui
private Client client
Client that can be used to send messages to
the server.
private Game game
private Player player
private boolean isRetired
private boolean inGame
private FreeColServer freeColServer
private boolean mapEditor
private boolean singleplayer
private final ActionManager actionManager
private ClientOptions clientOptions
public final Worker worker
private boolean loggedIn
private boolean headless
| Constructor Detail |
|---|
public FreeColClient(java.io.File savedGame,
java.awt.Dimension size,
boolean sound,
java.lang.String splashFilename,
boolean showOpeningVideo,
java.lang.String fontName)
FreeColClient. Creates the control objects
and starts the GUI.
savedGame - An optional saved game.size - An optional window size.sound - True if sounds should be playedsplashFilename - The name of the splash image.showOpeningVideo - Display the opening video.fontName - An optional override of the main font.| Method Detail |
|---|
public ServerAPI askServer()
public void askToQuit()
#showConfirmDialog in
order to get a "Are you sure"-confirmation from the user.
public boolean canSaveCurrentGame()
public void continuePlaying()
public boolean currentPlayerIsMyPlayer()
public ActionManager getActionManager()
ActionManager.public Client getClient()
Client that can be used to send messages to the
server.
ClientsetClient(net.sf.freecol.client.networking.Client)public ClientOptions getClientOptions()
ClientOptions.public ConnectController getConnectController()
ConnectController.public FreeColServer getFreeColServer()
FreeColServer started by the client.
FreeColServer or null if no
server has been started.public Game getGame()
Game that we are currently playing.
Game.setGame(net.sf.freecol.common.model.Game)public GUI getGUI()
public InGameController getInGameController()
InGameController.public InGameInputHandler getInGameInputHandler()
InGameInputHandler.public MapEditorController getMapEditorController()
public Player getMyPlayer()
Player that uses this client.
Player made to represent this clients user.setMyPlayer(Player)public PreGameController getPreGameController()
PreGameController.public PreGameInputHandler getPreGameInputHandler()
PreGameInputHandler.public boolean isAdmin()
public boolean isHeadless()
Headless value.
boolean valuepublic boolean isInGame()
setInGame(boolean)public boolean isLoggedIn()
public boolean isMapEditor()
public boolean isSingleplayer()
setSingleplayer(boolean)public void newGame()
public void quit()
public void retire()
#showConfirmDialog in
order to get a "Are you sure"-confirmation from the user.
public void setClient(Client client)
Client that shall be used to send messages to the
server.
client - the ClientgetClient()public void setFreeColServer(FreeColServer freeColServer)
FreeColServer which has been started by the
client gui.
freeColServer - The FreeColServer.getFreeColServer()public void setGame(Game game)
Game that we are currently playing.
game - The Game.getGame()public void setHeadless(boolean newHeadless)
Headless value.
newHeadless - The new Headless value.public void setInGame(boolean inGame)
inGame - Indicates whether or not the game has started.public void setIsRetired(boolean isRetired)
isRetired - Indicates whether or not the user has retired the game.public void setLoggedIn(boolean loggedIn)
loggedIn - An indication of whether or not this client is logged in
to a server.public void setMapEditor(boolean mapEditor)
public void setMyPlayer(Player player)
Player that uses this client.
player - The Player made to represent this clients
user.getMyPlayer()public void setSingleplayer(boolean singleplayer)
singleplayer - Indicates whether or not this game is a singleplayer
game.isSingleplayer()public void skipTurns(int turns)
turns - The number of turns to skip.private void exitActions()
private void loadClientOptions(java.io.File savedGame)
savedGame - An optional File to load options from.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||