rails.game.move
Class CashMove

java.lang.Object
  extended by rails.game.move.Move
      extended by rails.game.move.CashMove

public class CashMove
extends Move

Author:
Erik Vos

Field Summary
(package private)  int amount
           
(package private)  CashHolder from
           
(package private)  CashHolder to
           
 
Fields inherited from class rails.game.move.Move
log, models
 
Constructor Summary
CashMove(CashHolder from, CashHolder to, int amount)
          Create a CashMove instance.
 
Method Summary
 boolean execute()
           
 java.lang.String toString()
           
 boolean undo()
           
 
Methods inherited from class rails.game.move.Move
registerModelToUpdate, updateModels
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

amount

int amount

from

CashHolder from

to

CashHolder to
Constructor Detail

CashMove

public CashMove(CashHolder from,
                CashHolder to,
                int amount)
Create a CashMove instance. In this specific case either from or to may be null, in which case the Bank is implied.

Parameters:
from - The cash payer (null implies the Bank).
to - The cash payee (null implies the Bank).
amount -
Method Detail

execute

public boolean execute()
Specified by:
execute in class Move

undo

public boolean undo()
Specified by:
undo in class Move

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object