rails.game.move
Class ObjectMove
java.lang.Object
rails.game.move.Move
rails.game.move.ObjectMove
public class ObjectMove
- extends Move
- Author:
- Erik Vos
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
moveableObject
Moveable moveableObject
from
MoveableHolder from
to
MoveableHolder to
objectClassName
java.lang.String objectClassName
fromPosition
int[] fromPosition
toPosition
int[] toPosition
ObjectMove
public ObjectMove(Moveable moveableObject,
MoveableHolder from,
MoveableHolder to)
- Create a generic ObjectMove object. Any specific side effects must be
implemented in the various addXxxx and removeXxxx methods of the 'from' and
'to' MoveableHolders, depending on the object type.
- Parameters:
moveableObject
- The object to be moved (e.g. a BaseToken).from
- Where the moveableObject is removed from (e.g. a PublicCompany charter).to
- Where the moveableObject is moved to (e.g. a MapHex).
It is moved to the end of the List in which the moved object type is stored.
ObjectMove
public ObjectMove(Moveable moveableObject,
MoveableHolder from,
MoveableHolder to,
int[] toPosition)
- Create a generic ObjectMove object. Any specific side effects must be
implemented in the various addXxxx and removeXxxx methods of the 'from' and
'to' MoveableHolders, depending on the object type.
- Parameters:
moveableObject
- The object to be moved (e.g. a BaseToken).from
- Where the moveableObject is removed from (e.g. a PublicCompany charter).to
- Where the moveableObject is moved to (e.g. a MapHex).toPosition
- At which List index in the 'to' holder the object must be inserted,
-1 means at the end.
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