server.framework.models
Class SettingsList

java.lang.Object
  extended by server.framework.models.SettingsList

public class SettingsList
extends java.lang.Object

This class contains a list of the settings applying to a session, and is used by the session's GameThread to ensure the validity of the game's current state. When settings are added to a game, this class needs to have the settings added.

Author:
Eivind Sorteberg, Martin Jarrett

Constructor Summary
SettingsList()
          Initialises the list of settings.
 
Method Summary
 void fireSettingChanged(java.lang.String[][] values)
          Method that is called whenever a player has changed the value of one or more settings.
 java.lang.Object getSetting(Setting setting)
          Method used to get a setting's value.
 java.util.HashMap<Setting,java.lang.Object> getSettings()
           
 java.lang.Object[][] getSettingsList()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SettingsList

public SettingsList()
Initialises the list of settings.

Method Detail

getSettingsList

public java.lang.Object[][] getSettingsList()
Returns:
An array containing the settings' names and values.

getSettings

public java.util.HashMap<Setting,java.lang.Object> getSettings()
Returns:
The settings list.

getSetting

public java.lang.Object getSetting(Setting setting)
Method used to get a setting's value.

Parameters:
setting - The setting.
Returns:
The specified setting's value.

fireSettingChanged

public void fireSettingChanged(java.lang.String[][] values)
Method that is called whenever a player has changed the value of one or more settings. Updates the relevant setting's values.

Parameters:
values - The names and values of the changed settings.