rails.game.model
Class CashModel

java.lang.Object
  extended by java.util.Observable
      extended by rails.game.model.ModelObject
          extended by rails.game.model.CashModel

public class CashModel
extends ModelObject


Field Summary
protected  int cash
           
protected  StringState displayText
          Text to be displayed instead of the cash amount (if length > 0)
protected  CashHolder owner
           
static int SUPPRESS_ZERO
           
 
Fields inherited from class rails.game.model.ModelObject
dependents, log, option
 
Constructor Summary
CashModel(CashHolder owner)
           
 
Method Summary
 void addCash(int addedCash)
           
 int getCash()
           
 java.lang.String getText()
          The object that is sent to the Observer along with a notification.
 void setCash(int newCash)
           
 void setText(java.lang.String text)
           
 
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, toString, wait, wait, wait
 

Field Detail

cash

protected int cash

owner

protected CashHolder owner

displayText

protected StringState displayText
Text to be displayed instead of the cash amount (if length > 0)


SUPPRESS_ZERO

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

CashModel

public CashModel(CashHolder owner)
Method Detail

setCash

public void setCash(int newCash)

addCash

public void addCash(int addedCash)

getCash

public int getCash()

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.

Specified by:
getText in class ModelObject
Returns:

setText

public void setText(java.lang.String text)