|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectsoc.server.SOCGameBoardReset
This class holds data the server needs, related to a "board reset" of a game being played.
SOCGameList.resetBoard(String),
SOCGame.resetAsCopy()| Field Summary | |
boolean |
hadRobots
Were there robots in the old game? |
StringConnection[] |
humanConns
Human and robot connections; both arrays null at vacant seats. |
SOCGame |
newGame
The new game, created from an old game by SOCGame.resetAsCopy() |
StringConnection[] |
robotConns
Human and robot connections; both arrays null at vacant seats. |
boolean[] |
wasRobot
Was this player position a robot? Indexed 0 to SOCGame.MAXPLAYERS-1 |
| Constructor Summary | |
SOCGameBoardReset(SOCGame oldGame,
java.util.Vector memberConns)
Create a SOCGameReset: Extract data, reset the old game, and gather new data. |
|
| Method Summary | |
static int |
sortPlayerConnections(SOCGame newGame,
SOCGame oldGame,
java.util.Vector memberConns,
StringConnection[] humanConns,
StringConnection[] robotConns)
Grab connection information for this game's humans and robots. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public SOCGame newGame
SOCGame.resetAsCopy()
public boolean hadRobots
public StringConnection[] humanConns
SOCGame.resetAsCopy() will duplicate human players
in the new game, but not robot players.
Indexed 0 to SOCGame.MAXPLAYERS-1
public StringConnection[] robotConns
SOCGame.resetAsCopy() will duplicate human players
in the new game, but not robot players.
Indexed 0 to SOCGame.MAXPLAYERS-1
public boolean[] wasRobot
| Constructor Detail |
public SOCGameBoardReset(SOCGame oldGame,
java.util.Vector memberConns)
oldGame - Game to reset - SOCGame.resetAsCopy()
will be called. The old game's state will be changed to RESET_OLD.memberConns - Game members (StringConnections),
as retrieved by SOCGameList.getMembers(String).
Contents of this vector will be changed to remove any robot members.| Method Detail |
public static int sortPlayerConnections(SOCGame newGame,
SOCGame oldGame,
java.util.Vector memberConns,
StringConnection[] humanConns,
StringConnection[] robotConns)
Two modes:
If currently copying a game, assumes newGame is from oldGame via SOCGame.resetAsCopy(),
and newGame contains only the human players, oldGame also will contain robot players.
If not copying a game, oldGame is null, and assumes newGame has all players (both human and robot).
newGame - New game (if resetting), or only gameoldGame - Old game (if resetting), or nullmemberConns - Members of old game, from SOCGameList.getMembers(String); a Vector of StringConnectionshumanConns - Array to fill with human players; indexed 0 to SOCGame.MAXPLAYERS-1robotConns - Array to fill with robot players; indexed 0 to SOCGame.MAXPLAYERS-1
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||