dk.brics.bisimulationGame.model
Class OptionsModel

java.lang.Object
  extended by dk.brics.bisimulationGame.model.OptionsModel

public class OptionsModel
extends java.lang.Object

Data model for the game options. Used to hold the game options chosen by the user.

These are:

Author:
Martin Mosegaard martinm@daimi.au.dk

Field Summary
static int ATTACKER
           
static int BISIMULATION_STRONG
           
static int BISIMULATION_WEAK
           
private  int bisimulationType
           
static int BOTH
           
private static java.lang.String CHOOSE_BISIMULATION
           
private static java.lang.String CHOOSE_CLIENT_SERVER
           
private static java.lang.String CHOOSE_HOST
           
private static java.lang.String CHOOSE_LEFT_LTS
           
private static java.lang.String CHOOSE_PLAYERS
           
private static java.lang.String CHOOSE_RIGHT_LTS
           
private static java.lang.String CHOOSE_ROLE
           
static int CLIENT
           
private  int clientServer
           
static int DEFENDER
           
private  java.lang.String host
           
private  java.lang.String leftLTSFile
           
private  java.lang.String leftLTSPath
           
static int LOCAL
           
static int ONE_PLAYER
           
private  int players
           
private  java.lang.String rightLTSFile
           
private  java.lang.String rightLTSPath
           
private  int role
           
static int SERVER
           
static int TWO_PLAYER_LOCAL
           
static int TWO_PLAYER_REMOTE
           
 
Constructor Summary
OptionsModel()
          Creates an options model.
 
Method Summary
 void checkRole()
          This is a hack to ensure that a two player local game gets role=both.
 int getBisimulationType()
           
 int getClientServer()
           
 java.lang.String getHost()
           
 java.lang.String getLeftLTSFile()
           
 java.lang.String getLeftLTSPath()
           
 int getPlayers()
           
 java.lang.String getRightLTSFile()
           
 java.lang.String getRightLTSPath()
           
 int getRole()
           
 java.lang.String hasProperties()
          Checks if the user has chosen game properties.
 void setBisimulationType(int bisimulationType)
          Set the bisimulation type.
 void setClientServer(int clientServer)
          Set the client/server type.
 void setHost(java.lang.String host)
          Set the host.
 void setLeftLTSFile(java.lang.String leftLTSFile)
          Set the left LTS file
 void setLeftLTSPath(java.lang.String leftLTSPath)
          Set the path of the left LTS.
 void setPlayers(int players)
          Set the number of players.
 void setRightLTSFile(java.lang.String rightLTSFile)
          Set the right LTS file.
 void setRightLTSPath(java.lang.String rightLTSPath)
          Set the path of the right LTS.
 void setRole(int role)
          Set the role.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHOOSE_PLAYERS

private static final java.lang.String CHOOSE_PLAYERS
See Also:
Constant Field Values

CHOOSE_ROLE

private static final java.lang.String CHOOSE_ROLE
See Also:
Constant Field Values

CHOOSE_HOST

private static final java.lang.String CHOOSE_HOST
See Also:
Constant Field Values

CHOOSE_CLIENT_SERVER

private static final java.lang.String CHOOSE_CLIENT_SERVER
See Also:
Constant Field Values

CHOOSE_LEFT_LTS

private static final java.lang.String CHOOSE_LEFT_LTS
See Also:
Constant Field Values

CHOOSE_RIGHT_LTS

private static final java.lang.String CHOOSE_RIGHT_LTS
See Also:
Constant Field Values

CHOOSE_BISIMULATION

private static final java.lang.String CHOOSE_BISIMULATION
See Also:
Constant Field Values

ONE_PLAYER

public static final int ONE_PLAYER
See Also:
Constant Field Values

TWO_PLAYER_LOCAL

public static final int TWO_PLAYER_LOCAL
See Also:
Constant Field Values

TWO_PLAYER_REMOTE

public static final int TWO_PLAYER_REMOTE
See Also:
Constant Field Values

ATTACKER

public static final int ATTACKER
See Also:
Constant Field Values

DEFENDER

public static final int DEFENDER
See Also:
Constant Field Values

BOTH

public static final int BOTH
See Also:
Constant Field Values

CLIENT

public static final int CLIENT
See Also:
Constant Field Values

SERVER

public static final int SERVER
See Also:
Constant Field Values

LOCAL

public static final int LOCAL
See Also:
Constant Field Values

BISIMULATION_STRONG

public static final int BISIMULATION_STRONG
See Also:
Constant Field Values

BISIMULATION_WEAK

public static final int BISIMULATION_WEAK
See Also:
Constant Field Values

players

private int players

role

private int role

clientServer

private int clientServer

bisimulationType

private int bisimulationType

leftLTSPath

private java.lang.String leftLTSPath

rightLTSPath

private java.lang.String rightLTSPath

leftLTSFile

private java.lang.String leftLTSFile

rightLTSFile

private java.lang.String rightLTSFile

host

private java.lang.String host
Constructor Detail

OptionsModel

public OptionsModel()
Creates an options model.

Method Detail

hasProperties

public java.lang.String hasProperties()
Checks if the user has chosen game properties.

Returns:
Status string which is empty in case properties have been chosen

getBisimulationType

public int getBisimulationType()
Returns:
The bisimulation type (strong/weak)

setBisimulationType

public void setBisimulationType(int bisimulationType)
Set the bisimulation type.

Parameters:
bisimulationType - Strong or weak as defined in constant field values

getLeftLTSFile

public java.lang.String getLeftLTSFile()
Returns:
The left LTS file

setLeftLTSFile

public void setLeftLTSFile(java.lang.String leftLTSFile)
Set the left LTS file

Parameters:
leftLTSFile - A file name

getLeftLTSPath

public java.lang.String getLeftLTSPath()
Returns:
The path of the left LTS

setLeftLTSPath

public void setLeftLTSPath(java.lang.String leftLTSPath)
Set the path of the left LTS.

Parameters:
leftLTSPath - A path name

getRightLTSFile

public java.lang.String getRightLTSFile()
Returns:
The right LTS file

setRightLTSFile

public void setRightLTSFile(java.lang.String rightLTSFile)
Set the right LTS file.

Parameters:
rightLTSFile - A file name

getRightLTSPath

public java.lang.String getRightLTSPath()
Returns:
The path name of the right LTS

setRightLTSPath

public void setRightLTSPath(java.lang.String rightLTSPath)
Set the path of the right LTS.

Parameters:
rightLTSPath - A path name

getClientServer

public int getClientServer()
Returns:
The client/server type as defined in constant field values

setClientServer

public void setClientServer(int clientServer)
Set the client/server type.

Parameters:
clientServer - A constant field value

getPlayers

public int getPlayers()
Returns:
The number of players

setPlayers

public void setPlayers(int players)
Set the number of players.

Parameters:
players - A constant field value

getRole

public int getRole()
Returns:
The role

setRole

public void setRole(int role)
Set the role.

Parameters:
role - A constant field value

getHost

public java.lang.String getHost()
Returns:
The host

setHost

public void setHost(java.lang.String host)
Set the host.

Parameters:
host - A host name (IP address)

checkRole

public void checkRole()
This is a hack to ensure that a two player local game gets role=both.