org.jogre.common.util
Class GameProperties

java.lang.Object
  extended byorg.jogre.common.util.AbstractProperties
      extended byorg.jogre.common.util.GameProperties
All Implemented Interfaces:
IJogre

public class GameProperties
extends AbstractProperties
implements IJogre

This class provides an easy and effective point for accessing to each game resource bundle (game.properties).

Version:
Alpha 0.2.3
Author:
Bob Marks

Field Summary
 
Fields inherited from class org.jogre.common.util.AbstractProperties
rb
 
Fields inherited from interface org.jogre.common.IJogre
APPLET_PARAM_PASSWORD, APPLET_PARAM_SERVER_HOST, APPLET_PARAM_SERVER_PORT, APPLET_PARAM_USERNAME, DEFAULT_ELO_K_FACTOR, DEFAULT_ELO_START_RATING, DEFAULT_MAX_NUM_OF_PLAYERS, DEFAULT_MAX_NUM_OF_TABLES, DEFAULT_MAX_NUM_OF_TABLES_PER_USER, DEFAULT_MAX_NUM_OF_USERS, DEFAULT_MIN_NUM_OF_PLAYERS, DEFAULT_NUM_OF_PLAYERS, DEFAULT_PORT, DEFAULT_REQ_NUM_OF_PLAYERS, MASTER_SERVE_KEY, PROVISIONAL_COUNT, VERSION
 
Method Summary
static Color getBackgroundColour()
          Return the background colour of the JOGRE table frame.
static String getGameID()
          Return the game ID.
static String getGameNoID()
          Return the game label on its own.
static Vector getImageInfo()
          Return a vector of images where images are defined as image.0, image.1, ...
static GameProperties getInstance()
          Accessor to singleton instance of this class.
static int getMaxNumOfTables()
          Return the minimum number of players in a game.
static int getMaxNumOfTablesPerUser()
          Return the maximum number of tables that a user can create.
static Color getPlayerColour(int playerNum)
          Return the color of a player (each player has a specific colour which is used throughout the API).
static String getRulesFilename()
          Return the name of the rules file
static boolean isApplet()
          Static method which return true if this is an applet.
static void setApplet(boolean isApplet)
          Static method for setting true/false if this is an applet.
 
Methods inherited from class org.jogre.common.util.AbstractProperties
get, get, get, getBoolean, getBoolean, getInt, getInt, getResourceBundle, reload, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static GameProperties getInstance()
Accessor to singleton instance of this class.

Returns:
Instance of this class.

getMaxNumOfTables

public static int getMaxNumOfTables()
Return the minimum number of players in a game.

Returns:
Max num of players.

getMaxNumOfTablesPerUser

public static int getMaxNumOfTablesPerUser()
Return the maximum number of tables that a user can create.

Returns:

getGameID

public static String getGameID()
Return the game ID.

Returns:
GameID e.g. chess.

getGameNoID

public static String getGameNoID()
Return the game label on its own.

Returns:
Game label (no id) - e.g. chess.

getPlayerColour

public static Color getPlayerColour(int playerNum)
Return the color of a player (each player has a specific colour which is used throughout the API).

Parameters:
playerNum - Supplied player number
Returns:
Color

getBackgroundColour

public static Color getBackgroundColour()
Return the background colour of the JOGRE table frame.

Returns:
Color

isApplet

public static boolean isApplet()
Static method which return true if this is an applet.

Returns:

setApplet

public static void setApplet(boolean isApplet)
Static method for setting true/false if this is an applet.

Parameters:
isApplet - If true this is an applet.

getImageInfo

public static Vector getImageInfo()

Return a vector of images where images are defined as image.0, image.1, ... image.n.

Each image info will consist of the image and its size in bytes:

e.g. chess_icon,456

Returns:
Vector of image strings.

getRulesFilename

public static String getRulesFilename()
Return the name of the rules file

Returns:
Rules filename