rails.game.model
Class CashModel
java.lang.Object
java.util.Observable
rails.game.model.ModelObject
rails.game.model.CashModel
public class CashModel
- extends ModelObject
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 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 |
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
CashModel
public CashModel(CashHolder owner)
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)