|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.io.SimpleStreamableObject
com.threerings.crowd.data.PlaceConfig
com.threerings.parlor.game.data.GameConfig
public abstract class GameConfig
The game config class encapsulates the configuration information for a particular type of game. The hierarchy of game config objects mimics the hierarchy of game managers and controllers. Both the game manager and game controller are provided with the game config object when the game is created.
The game config object is also the mechanism used to instantiate the appropriate game
manager and controller. Every game must have an associated game config derived class that
overrides PlaceConfig.createController() and PlaceConfig.getManagerClassName(),
returning the appropriate game controller and manager class for that game. Thus the entire chain
of events that causes a particular game to be created is the construction of the appropriate
game config instance which is provided to the server as part of an invitation or via some other
matchmaking mechanism.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
com.threerings.io.Streamable.Closure |
| Field Summary | |
|---|---|
GameAI[] |
ais
Configurations for AIs to be used in this game. |
static int |
PARTY
Matchmaking type constant: a game that starts immediately, and every user that enters is a player. |
com.threerings.util.Name[] |
players
The usernames of the players involved in this game, or an empty array if such information is not needed by this particular game. |
boolean |
rated
Indicates whether or not this game is rated. |
static int |
SEATED_CONTINUOUS
Matchmaking type constant: a game that starts immediately, but only has a certain number of player slots. |
static int |
SEATED_GAME
Matchmaking type constant: a game that is started with a list of players, and those are the only players that may play. |
static String[] |
TYPE_STRINGS
Maps the matchmaking type codes into strings used in our XML configuration. |
| Constructor Summary | |
|---|---|
GameConfig()
|
|
| Method Summary | |
|---|---|
GameConfig |
clone()
|
GameConfigurator |
createConfigurator()
Creates a configurator that can be used to create a user interface for configuring this instance prior to starting the game. |
TableConfigurator |
createTableConfigurator()
Creates a table configurator for initializing 'table' properties of the game. |
boolean |
equals(Object other)
Returns true if this game config object is equal to the supplied object (meaning it is a game config for the same game and its configuration settings are the same as ours). |
List<String> |
getDescription()
Returns a List of strings that describe the configuration of this game. |
abstract int |
getGameId()
Returns a numeric identifier for this game class. |
abstract String |
getGameIdent()
Returns a string identifier for this game class (e.g. |
int |
getMatchType()
Returns the matchmaking type of this game: SEATED_GAME, etc. |
int |
hashCode()
Computes a hashcode for this game config object that supports our equals(java.lang.Object)
implementation. |
| Methods inherited from class com.threerings.crowd.data.PlaceConfig |
|---|
createController, getControllerClass, getManagerClassName |
| Methods inherited from class com.threerings.io.SimpleStreamableObject |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SEATED_GAME
public static final int SEATED_CONTINUOUS
public static final int PARTY
public static final String[] TYPE_STRINGS
public com.threerings.util.Name[] players
public boolean rated
public GameAI[] ais
| Constructor Detail |
|---|
public GameConfig()
| Method Detail |
|---|
public abstract int getGameId()
public abstract String getGameIdent()
public int getMatchType()
SEATED_GAME, etc.
public GameConfigurator createConfigurator()
public TableConfigurator createTableConfigurator()
public List<String> getDescription()
public boolean equals(Object other)
equals in class Objectpublic int hashCode()
equals(java.lang.Object)
implementation. Objects that are equal should have the same hashcode.
hashCode in class Objectpublic GameConfig clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||