|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gjt.universe.PlayerList
The this class handles look-up of specific players. by their unique ID. All players currently in the game will be present in the list, with eliminated players being removed as needed. Also note that rather than being eliminated a a player may simply be assigned a new civilization, depending on game options and other factors. Furthermore, a human player may resign from the game in which case a new player (computer or human) will be added to the game in their place and given control of the resigning player's civilization.
PlayerBase
,
CivList
Field Summary | |
private static DBTable |
DB
|
Constructor Summary | |
private |
PlayerList()
This is declared private as no actual instance of this class is ever created (all methods are static). |
Method Summary | |
static void |
add(PlayerBase obj)
This method adds the given player to the master list of those currently in the game. |
static java.util.Enumeration |
elements()
This method returns an enumeration of all players currently in the game. |
static PlayerBase |
get(PlayerID id)
This method returns the player with the given ID. |
(package private) static void |
readObject(java.io.ObjectInputStream in)
This method takes the list of players stored in the given stream (previously written using writeObject) as the current list of those available in the game. |
static PlayerBase |
remove(PlayerID id)
This method removes the given player from the master list of those currently in the game. |
static int |
size()
This method returns the number of players in the game. |
(package private) static void |
writeObject(java.io.ObjectOutputStream out)
This method adds the current list of players to the given stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static DBTable DB
Constructor Detail |
private PlayerList()
Method Detail |
public static void add(PlayerBase obj)
obj
- The player to be added.public static PlayerBase remove(PlayerID id)
public static PlayerBase get(PlayerID id)
id
- The unique ID of the desired player object.class.
public static int size()
static void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
readObject
static void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
writeObject
public static java.util.Enumeration elements()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |