|
|||||||||
| 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 | |
|---|---|
static java.lang.String |
COPYRIGHT
|
static java.lang.String |
LICENSE
|
static java.lang.String |
REVISION
|
Worker |
worker
|
| Constructor Summary | |
|---|---|
FreeColClient(boolean windowed,
java.awt.Rectangle windowSize,
ImageLibrary imageLibrary,
MusicLibrary musicLibrary,
SfxLibrary sfxLibrary)
Creates a new FreeColClient. |
|
| Method Summary | |
|---|---|
ActionManager |
getActionManager()
Gets the object responsible for keeping and updating the actions. |
Canvas |
getCanvas()
Gets the Canvas this client uses to display the
GUI-components. |
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()
Gets the GUI that is beeing used to draw the map on the
Canvas. |
ImageLibrary |
getImageLibrary()
Gets the ImageLibrary. |
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. |
ClientModelController |
getModelController()
Gets the ClientModelController. |
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. |
PseudoRandom |
getPseudoRandom()
Get the pseudo-random number generator for the client. |
boolean |
isAdmin()
Checks if this client is the game admin. |
boolean |
isLoggedIn()
Returns true if this client is logged in to a server or false otherwise. |
boolean |
isSingleplayer()
Is the user playing in singleplayer mode. |
void |
loadClientOptions()
Reads the ClientOptions from the given file. |
void |
loadClientOptions(java.io.File loadFile)
Reads the ClientOptions from the given file. |
void |
playSound(int sound)
Plays the given sound effect. |
void |
quit()
Quits the application without any questions. |
void |
saveClientOptions()
Writes the client options to the default location. |
void |
saveClientOptions(java.io.File saveFile)
Writes the client options to the given file. |
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 |
setLoggedIn(boolean loggedIn)
Sets whether or not this client is logged in to a server. |
void |
setMyPlayer(Player player)
Sets the Player that uses this client. |
void |
setSingleplayer(boolean singleplayer)
Sets wether or not this game is a singleplayer game. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COPYRIGHT
public static final java.lang.String LICENSE
public static final java.lang.String REVISION
public final Worker worker
| Constructor Detail |
|---|
public FreeColClient(boolean windowed,
java.awt.Rectangle windowSize,
ImageLibrary imageLibrary,
MusicLibrary musicLibrary,
SfxLibrary sfxLibrary)
FreeColClient. Creates the control objects
and starts the GUI.
windowed - Determines if the Canvas should be
displayed within a JFrame (when
true) or in fullscreen mode (when
false).windowSize - The size of the window if not in fullscreen mode.imageLibrary - The object holding the images.musicLibrary - The object holding the music.sfxLibrary - The object holding the sound effects.| Method Detail |
|---|
public void saveClientOptions()
ClientOptionspublic void saveClientOptions(java.io.File saveFile)
saveFile - The file where the client options should be written.ClientOptionspublic ImageLibrary getImageLibrary()
ImageLibrary.
ImageLibrary.public void loadClientOptions()
ClientOptions from the given file.
public void loadClientOptions(java.io.File loadFile)
ClientOptions from the given file.
loadFile - The File to read the
ClientOptions from.public ActionManager getActionManager()
ActionManager.public ClientOptions getClientOptions()
ClientOptions.public Player getMyPlayer()
Player that uses this client.
Player made to represent this clients user.setMyPlayer(Player)public void setMyPlayer(Player player)
Player that uses this client.
player - The Player made to represent this clients
user.getMyPlayer()public void setFreeColServer(FreeColServer freeColServer)
FreeColServer which has been started by the
client gui.
freeColServer - The FreeColServer.getFreeColServer()public FreeColServer getFreeColServer()
FreeColServer started by the client.
FreeColServer or null if no
server has been started.public void setGame(Game game)
Game that we are currently playing.
game - The Game.getGame()public Game getGame()
Game that we are currently playing.
Game.setGame(net.sf.freecol.common.model.Game)public Canvas getCanvas()
Canvas this client uses to display the
GUI-components.
Canvas.public GUI getGUI()
GUI that is beeing used to draw the map on the
Canvas.
GUI.public void quit()
public boolean isAdmin()
public void setSingleplayer(boolean singleplayer)
singleplayer - Indicates wether or not this game is a singleplayer
game.isSingleplayer()public boolean isSingleplayer()
setSingleplayer(boolean)public ConnectController getConnectController()
ConnectController.public PreGameController getPreGameController()
PreGameController.public PreGameInputHandler getPreGameInputHandler()
PreGameInputHandler.public InGameController getInGameController()
InGameController.public InGameInputHandler getInGameInputHandler()
InGameInputHandler.public ClientModelController getModelController()
ClientModelController.
ClientModelController.public void setClient(Client client)
Client that shall be used to send messages to the
server.
client - the ClientgetClient()public Client getClient()
Client that can be used to send messages to the
server.
ClientsetClient(net.sf.freecol.client.networking.Client)public void playSound(int sound)
sound - The key sound effect given by SfxLibrary.public boolean isLoggedIn()
public void setLoggedIn(boolean loggedIn)
loggedIn - An indication of whether or not this client is logged in
to a server.public PseudoRandom getPseudoRandom()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||