|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ks.common.model.Move | +--heineman.klondike.MoveColumnMove
Represents the move of a column between Piles.
There are two scenarios when constructing a moveColumnMove
object. (1) The move has not yet taken place (but is being proposed); in this
case, there is no Column being moved, only a number of cards. (2) The move has
already occured, so the Column is available, and the number of cards can easily
be calculated.
Field Summary | |
protected Column |
columnBeingDragged
Column being moved. |
protected BuildablePile |
from
From BuildablePile. |
protected int |
numCards
Number of cards to move. |
protected BuildablePile |
to
To BuildablePile. |
Constructor Summary | |
MoveColumnMove(BuildablePile fromPile,
BuildablePile toPile,
Column columnBeingDragged,
int numCards)
MoveCardToFoundationmove constructor. |
Method Summary | |
boolean |
doMove(Solitaire theGame)
Each move should knows how to execute itself. |
boolean |
undo(ks.common.games.Solitaire game)
undo of a MoveColumnMove. |
boolean |
valid(Solitaire game)
Action for Klondike: Move a Column from one BuildablePile to another |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected BuildablePile from
protected BuildablePile to
protected int numCards
protected Column columnBeingDragged
Constructor Detail |
public MoveColumnMove(BuildablePile fromPile, BuildablePile toPile, Column columnBeingDragged, int numCards)
If the move has already been made, then columnBeingDragged
is non-null, and
numCards == columnBeingDragged.count()
If the move has not been made, then
only the number of cards to be moved is known, and columnBeingDragged
is null.
Method Detail |
public boolean doMove(Solitaire theGame)
public boolean undo(ks.common.games.Solitaire game)
public boolean valid(Solitaire game)
game
- ks.game.Solitaire
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |