heineman.klondike
Class MoveWasteToFoundationMove

java.lang.Object
  |
  +--ks.common.model.Move
        |
        +--heineman.klondike.MoveWasteToFoundationMove

public class MoveWasteToFoundationMove
extends ks.common.model.Move

Represents the move of a card from the waste pile to the foundation

See Also:
Serialized Form

Field Summary
protected  Card draggingCard
          The Card being dragged.
protected  Pile foundation
          The Foundation Pile.
protected  Pile waste
          The Waste Pile.
 
Constructor Summary
MoveWasteToFoundationMove(Pile waste, Card draggingCard, Pile foundation)
          MoveWasteToFoundationMove constructor.
 
Method Summary
 boolean doMove(Solitaire theGame)
          Each move should knows how to execute itself.
 boolean undo(ks.common.games.Solitaire game)
          Move the card back to the waste pile.
 boolean valid(ks.common.games.Solitaire game)
          Action for Klondike: WastePile card dragged to Foundation Pile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

waste

protected Pile waste
The Waste Pile.


draggingCard

protected Card draggingCard
The Card being dragged.


foundation

protected Pile foundation
The Foundation Pile.

Constructor Detail

MoveWasteToFoundationMove

public MoveWasteToFoundationMove(Pile waste,
                                 Card draggingCard,
                                 Pile foundation)
MoveWasteToFoundationMove constructor.

If draggingCard is null, then the move has not yet been initiated, and a card is to be removed from waste and added to foundation.

If draggingCard is not null, then waste has already been modified, and the card removed from the top of the waste pile is draggingCard.

Method Detail

doMove

public boolean doMove(Solitaire theGame)
Each move should knows how to execute itself.

Creation date: (10/21/01 3:33:39 PM)

Returns:
boolean
Since:
V1.6.2

undo

public boolean undo(ks.common.games.Solitaire game)
Move the card back to the waste pile.

Note: in Undo, we always ignore the 'draggingCard' because the move has already happened.


valid

public boolean valid(ks.common.games.Solitaire game)
Action for Klondike: WastePile card dragged to Foundation Pile.