games.strategy.engine.data.properties
Class GameProperties

java.lang.Object
  extended by games.strategy.engine.data.GameDataComponent
      extended by games.strategy.engine.data.properties.GameProperties
All Implemented Interfaces:
java.io.Serializable

public class GameProperties
extends GameDataComponent

Properties of the current game.
Maps string -> Object
Set through changeFactory.setProperty.

Author:
Sean Bridges
See Also:
Serialized Form

Constructor Summary
GameProperties(GameData data)
          Creates a new instance of Properties
 
Method Summary
 void addEditableProperty(IEditableProperty property)
           
 java.lang.Object get(java.lang.String key)
          Could potentially return null.
 boolean get(java.lang.String key, boolean defaultValue)
           
 java.lang.Object get(java.lang.String key, java.lang.Object defaultValue)
           
 java.util.List<IEditableProperty> getEditableProperties()
          Return list of editable properties in the order they were added.
 void set(java.lang.String key, java.lang.Object value)
          Setting a property to null has the effect of unbinding the key.
 
Methods inherited from class games.strategy.engine.data.GameDataComponent
getData, readInternal, writeInternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameProperties

public GameProperties(GameData data)
Creates a new instance of Properties

Method Detail

set

public void set(java.lang.String key,
                java.lang.Object value)
Setting a property to null has the effect of unbinding the key. package access to prevent outsiders from setting properties


get

public java.lang.Object get(java.lang.String key)
Could potentially return null.
The object returned should not be modified, as modifications will not appear globally.


get

public boolean get(java.lang.String key,
                   boolean defaultValue)

get

public java.lang.Object get(java.lang.String key,
                            java.lang.Object defaultValue)

addEditableProperty

public void addEditableProperty(IEditableProperty property)

getEditableProperties

public java.util.List<IEditableProperty> getEditableProperties()
Return list of editable properties in the order they were added.

Returns:
a list of IEditableProperty