com.camelspotting.jotl.domain
Class ServerDetails

java.lang.Object
  extended by com.camelspotting.jotl.domain.ServerDetails

public final class ServerDetails
extends Object

This class is for parsing and holding the information from the server response package.

Version:
1.0
Author:
Eivind Brandth Smedseng, Mats Andreassen
See Also:
SendablePacketType

Constructor Summary
ServerDetails(List<NewGRF> newGRFs, String serverName, org.joda.time.LocalDate gameDate, org.joda.time.LocalDate startDate, int maxCompanies, int onCompanies, int maxSpectators, int onSpectators, int maxClients, int onClients, String gameVersion, int serverLang, boolean passwordProtected, boolean dedicated, int tileset, int mapHeight, int mapWidth, String mapName)
           
 
Method Summary
 org.joda.time.LocalDate getGameDate()
          Method for getting the current game date so that other formatting may be applied.
 int getGraphicsCount()
          Getter for the server new graphics count.
 int getMapHeight()
          Getter for the current map's height.
 String getMapName()
          Getter for the current map's name
 int getMapWidth()
          Getter for the current map's width.
 int getMaxNumberOfClients()
          Getter for maximum number of clients
 int getMaxNumberOfCompanies()
          Getter for maximum number of companies
 int getMaxNumberOfSpectators()
          Getter for maximum number of specatators.
 List<NewGRF> getNewGRFs()
           
 int getNumberOfActiveClients()
          Getter for the number of active clients.
 int getNumberOfActiveCompanies()
          Getter for the number of active companies.
 int getNumberOfActiveSpectators()
          Getter for the number of active spectators.
 int getServerLanguage()
          Getter for the server's language index.
 String getServerLanguageAsString()
          Getter for the server's language.
 String getServerName()
          Getter for the server name.
 org.joda.time.LocalDate getStartDate()
          Method for getting the start date so that other formatting may be applied.
 int getTileset()
          Getter for the tileset of the map
 String getTilesetAsString()
          Getter for the meaning of the tileset integer.
 String getVersion()
          Getter for the game version.
 int[] getVersionComponents()
          Getter for game version as components: major.minor.revision
 boolean isDedicated()
          Method for finding out whether or not the server is running in dedicated mode or if it is participating as a client.
 boolean isPasswordProtected()
          Method for finding out whether or not the server is password protected.
 String toString()
          Method for getting a textual representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerDetails

public ServerDetails(List<NewGRF> newGRFs,
                     String serverName,
                     org.joda.time.LocalDate gameDate,
                     org.joda.time.LocalDate startDate,
                     int maxCompanies,
                     int onCompanies,
                     int maxSpectators,
                     int onSpectators,
                     int maxClients,
                     int onClients,
                     String gameVersion,
                     int serverLang,
                     boolean passwordProtected,
                     boolean dedicated,
                     int tileset,
                     int mapHeight,
                     int mapWidth,
                     String mapName)
Method Detail

getServerName

public String getServerName()
Getter for the server name.

Returns:
the server name

getVersion

public String getVersion()
Getter for the game version.

Returns:
the game version

getVersionComponents

public int[] getVersionComponents()
Getter for game version as components: major.minor.revision

Returns:
the server version, e.g. 0.5.3

getGraphicsCount

public int getGraphicsCount()
Getter for the server new graphics count.

Returns:
the new graphics count

getNewGRFs

public List<NewGRF> getNewGRFs()

getStartDate

public org.joda.time.LocalDate getStartDate()
Method for getting the start date so that other formatting may be applied.

Returns:
date

getGameDate

public org.joda.time.LocalDate getGameDate()
Method for getting the current game date so that other formatting may be applied.

Returns:
date

getMaxNumberOfCompanies

public int getMaxNumberOfCompanies()
Getter for maximum number of companies

Returns:
the number

getNumberOfActiveCompanies

public int getNumberOfActiveCompanies()
Getter for the number of active companies.

Returns:
the number

getMaxNumberOfSpectators

public int getMaxNumberOfSpectators()
Getter for maximum number of specatators.

Returns:
the number

getNumberOfActiveSpectators

public int getNumberOfActiveSpectators()
Getter for the number of active spectators.

Returns:
the number

getMaxNumberOfClients

public int getMaxNumberOfClients()
Getter for maximum number of clients

Returns:
the number

getNumberOfActiveClients

public int getNumberOfActiveClients()
Getter for the number of active clients.

Returns:
the number

isPasswordProtected

public boolean isPasswordProtected()
Method for finding out whether or not the server is password protected.

Returns:
whether or not the server is password protected

getServerLanguage

public int getServerLanguage()
Getter for the server's language index.

Returns:
the language index
See Also:
getServerLanguageAsString()

getServerLanguageAsString

public String getServerLanguageAsString()
Getter for the server's language.

Returns:
the language see #getServerLanguage()

isDedicated

public boolean isDedicated()
Method for finding out whether or not the server is running in dedicated mode or if it is participating as a client.

Returns:
whether or not the serveris running in dedicated mode

getTilesetAsString

public String getTilesetAsString()
Getter for the meaning of the tileset integer.

Returns:
the string representation

getTileset

public int getTileset()
Getter for the tileset of the map

Returns:
the integer representation

getMapWidth

public int getMapWidth()
Getter for the current map's width.

Returns:
the width

getMapHeight

public int getMapHeight()
Getter for the current map's height.

Returns:
the height

getMapName

public String getMapName()
Getter for the current map's name

Returns:
the name

toString

public String toString()
Method for getting a textual representation of this object. Very useful for debugging.

Overrides:
toString in class Object
Returns:
a String containing all data.


Copyright © 2013. All Rights Reserved.