net.sf.freecol
Class FreeCol

java.lang.Object
  extended by net.sf.freecol.FreeCol

public final class FreeCol
extends java.lang.Object

This class is responsible for handling the command-line arguments and starting either the stand-alone server or the client-GUI.

See Also:
FreeColClient, FreeColServer

Field Summary
static java.lang.String CLIENT_THREAD
           
static java.lang.String META_SERVER_ADDRESS
           
static int META_SERVER_PORT
           
static java.lang.String METASERVER_THREAD
           
static java.lang.String SERVER_THREAD
           
 
Method Summary
static java.io.File getAutosaveDirectory()
          Returns the directory where the autogenerated savegames should be put.
static java.io.File getClientOptionsFile()
          Returns the file containing the client options.
static java.io.File getDataDirectory()
          Returns the data directory.
static int getDefaultPort()
          Returns the default server network port.
static FreeColClient getFreeColClient()
          Gets the FreeColClient.
static java.util.Locale getLocale()
          Determines the Locale to be used.
static java.io.File getModsDirectory()
          Returns the mods directory.
static java.lang.String getRevision()
          Gets the current revision of game.
static java.io.File getSaveDirectory()
          Returns the directory where the savegames should be put.
static Specification getSpecification()
          Returns the specification object for Freecol.
static java.io.InputStream getSpecificationInputStream()
           
static java.lang.String getVersion()
          Gets the current version of game.
static boolean initializeResourceFolders()
           
static boolean isInDebugMode()
          Checks if the program is in "Debug mode".
static void main(java.lang.String[] args)
          The entrypoint.
static void setInDebugMode(boolean debug)
          Sets the "debug mode" to be active or not.
static void setSaveDirectory(java.io.File saveDirectory)
          Set the directory where the savegames should be put.
static boolean usesExperimentalAI()
          Checks if the program is in "Experimental AI mode".
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

META_SERVER_ADDRESS

public static final java.lang.String META_SERVER_ADDRESS
See Also:
Constant Field Values

META_SERVER_PORT

public static final int META_SERVER_PORT
See Also:
Constant Field Values

CLIENT_THREAD

public static final java.lang.String CLIENT_THREAD
See Also:
Constant Field Values

SERVER_THREAD

public static final java.lang.String SERVER_THREAD
See Also:
Constant Field Values

METASERVER_THREAD

public static final java.lang.String METASERVER_THREAD
See Also:
Constant Field Values
Method Detail

main

public static void main(java.lang.String[] args)
The entrypoint.

Parameters:
args - The command-line arguments.

getLocale

public static java.util.Locale getLocale()
Determines the Locale to be used.

Returns:
Currently this method returns the locale set by the ClientOptions (read directly from "options.xml"). This behavior will probably be changed.

getDefaultPort

public static int getDefaultPort()
Returns the default server network port.

Returns:
The port number.

getClientOptionsFile

public static java.io.File getClientOptionsFile()
Returns the file containing the client options.

Returns:
The file.

getSpecification

public static Specification getSpecification()
Returns the specification object for Freecol.

Returns:
the specification to be used by all other classes.

getFreeColClient

public static FreeColClient getFreeColClient()
Gets the FreeColClient.

Returns:
The FreeColClient, or null if the game is run as a standalone server.

getSaveDirectory

public static java.io.File getSaveDirectory()
Returns the directory where the savegames should be put.

Returns:
The directory where the savegames should be put.

setSaveDirectory

public static void setSaveDirectory(java.io.File saveDirectory)
Set the directory where the savegames should be put.

Parameters:
saveDirectory - a File value for the savegame directory

getDataDirectory

public static java.io.File getDataDirectory()
Returns the data directory.

Returns:
The directory where the data files are located.

getModsDirectory

public static java.io.File getModsDirectory()
Returns the mods directory.

Returns:
The directory where the mods are located.

getAutosaveDirectory

public static java.io.File getAutosaveDirectory()
Returns the directory where the autogenerated savegames should be put.

Returns:
The directory.

getSpecificationInputStream

public static java.io.InputStream getSpecificationInputStream()
                                                       throws java.io.IOException
Throws:
java.io.IOException

initializeResourceFolders

public static boolean initializeResourceFolders()

getVersion

public static java.lang.String getVersion()
Gets the current version of game.

Returns:
The current version of the game using the format "x.y.z", where "x" is major, "y" is minor and "z" is revision.

getRevision

public static java.lang.String getRevision()
Gets the current revision of game.

Returns:
The current version and SVN Revision of the game.

isInDebugMode

public static boolean isInDebugMode()
Checks if the program is in "Debug mode".

Returns:
true if the program is in debug mode and false otherwise.

setInDebugMode

public static void setInDebugMode(boolean debug)
Sets the "debug mode" to be active or not.

Parameters:
debug - Should be true in order to active debug mode and false otherwise.

usesExperimentalAI

public static boolean usesExperimentalAI()
Checks if the program is in "Experimental AI mode".

Returns:
true if the program is in Experimental AI mode and false otherwise.