soc.util
Class SOCGameList.GameInfo

java.lang.Object
  extended by soc.util.SOCGameList.GameInfo
Direct Known Subclasses:
SOCGameListAtServer.GameInfoAtServer
Enclosing class:
SOCGameList

protected static class SOCGameList.GameInfo
extends java.lang.Object

Holds most information on one game, except its SOCGame object, which is kept separately. Includes mutexes to synchronize game state access. Kept within the SOCGameList.gameInfo map.

Since:
1.1.07
Author:
Jeremy D Monin

Field Summary
 boolean canJoin
           
 boolean gameDestroyed
          Flag for when game has been destroyed, in case anything's waiting on its mutex.
 MutexFlag mutex
           
 java.util.Map<java.lang.String,SOCGameOption> opts
           
 java.lang.String optsStr
           
 
Constructor Summary
SOCGameList.GameInfo(boolean canJoinGame, java.util.Map<java.lang.String,SOCGameOption> gameOpts)
          Constructor: gameOpts is null or contains game option objects
SOCGameList.GameInfo(boolean canJoinGame, java.lang.String gameOptsStr)
          Constructor: gameOptsStr is null or unparsed game options
 
Method Summary
 void dispose()
           
 java.util.Map<java.lang.String,SOCGameOption> parseOptsStr()
          Parse optsStr to opts, unless it's already been parsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mutex

public MutexFlag mutex

opts

public java.util.Map<java.lang.String,SOCGameOption> opts

optsStr

public java.lang.String optsStr

canJoin

public boolean canJoin

gameDestroyed

public boolean gameDestroyed
Flag for when game has been destroyed, in case anything's waiting on its mutex. @since 1.1.15

Constructor Detail

SOCGameList.GameInfo

public SOCGameList.GameInfo(boolean canJoinGame,
                            java.util.Map<java.lang.String,SOCGameOption> gameOpts)
Constructor: gameOpts is null or contains game option objects

Parameters:
canJoinGame - can we join this game?
gameOpts - The game's SOCGameOptions, or null

SOCGameList.GameInfo

public SOCGameList.GameInfo(boolean canJoinGame,
                            java.lang.String gameOptsStr)
Constructor: gameOptsStr is null or unparsed game options

Parameters:
canJoinGame - can we join this game?
gameOptsStr - set of SOCGameOptions as packed by SOCGameOption.packOptionsToString(Map, boolean), or null
Method Detail

parseOptsStr

public java.util.Map<java.lang.String,SOCGameOption> parseOptsStr()
Parse optsStr to opts, unless it's already been parsed.

Returns:
opts, after parsing if necessary, or null if opts==null and optsStr==null.

dispose

public void dispose()