rails.game.model
Class MoneyModel

java.lang.Object
  extended by java.util.Observable
      extended by rails.game.model.ModelObject
          extended by rails.game.state.State
              extended by rails.game.state.IntegerState
                  extended by rails.game.model.MoneyModel
All Implemented Interfaces:
StateI

public class MoneyModel
extends IntegerState


Field Summary
static int ADD_PLUS
           
static int ALLOW_NEGATIVE
           
static int SUPPRESS_INITIAL_ZERO
           
static int SUPPRESS_ZERO
           
 
Fields inherited from class rails.game.state.State
clazz, log, name, object
 
Fields inherited from class rails.game.model.ModelObject
dependents, option
 
Constructor Summary
MoneyModel(java.lang.String name)
           
MoneyModel(java.lang.String name, int value)
           
 
Method Summary
 java.lang.String getText()
          The object that is sent to the Observer along with a notification.
 void set(int value)
           
 void setText(java.lang.String text)
          Set a fixed text, which will override the money value as long as it is not null and not "".
 
Methods inherited from class rails.game.state.IntegerState
add, intValue
 
Methods inherited from class rails.game.state.State
get, getClassName, getName, set, set, setForced, setState, toString
 
Methods inherited from class rails.game.model.ModelObject
addDependent, addObserver, getUpdate, removeDependent, resetOption, setOption, update
 
Methods inherited from class java.util.Observable
clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SUPPRESS_ZERO

public static final int SUPPRESS_ZERO
See Also:
Constant Field Values

SUPPRESS_INITIAL_ZERO

public static final int SUPPRESS_INITIAL_ZERO
See Also:
Constant Field Values

ADD_PLUS

public static final int ADD_PLUS
See Also:
Constant Field Values

ALLOW_NEGATIVE

public static final int ALLOW_NEGATIVE
See Also:
Constant Field Values
Constructor Detail

MoneyModel

public MoneyModel(java.lang.String name)

MoneyModel

public MoneyModel(java.lang.String name,
                  int value)
Method Detail

set

public void set(int value)
Overrides:
set in class IntegerState

setText

public void setText(java.lang.String text)
Set a fixed text, which will override the money value as long as it is not null and not "".

Parameters:
text -

getText

public java.lang.String getText()
Description copied from class: ModelObject
The object that is sent to the Observer along with a notification. The default result is the Observable's toString(), but it can be overridden where needed.

Overrides:
getText in class IntegerState
Returns: