brlandry
Class ColumnToPileMove

java.lang.Object
  |
  +--Move
        |
        +--brlandry.ColumnToPileMove

public class ColumnToPileMove
extends Move

See Also:
Serialized Form

Field Summary
protected  Column from
           
protected  Card movingCard
           
protected  Pile to
           
 
Constructor Summary
ColumnToPileMove(Column from, Card movingCard, Pile to)
           
 
Method Summary
protected  boolean aceOverKing(int rank)
          Helper function to determine a "hypothetical card" is an Ace and if the top card on the "to" pile is a King.
 boolean doMove(Solitaire theGame)
          Execute the move
protected  boolean oneMore(int rank)
          Helper function to determine a "hypothetical card" has a rank of one greater than the top card on the "to" pile.
protected  boolean sameSuit(int suit)
          Helper function to determine a "hypothetical card" is of the same suit as the to pile.
 boolean undo(Solitaire theGame)
          Undo move (and score)
 boolean valid(Solitaire theGame)
          Moves can determine their validity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

from

protected Column from

to

protected Pile to

movingCard

protected Card movingCard
Constructor Detail

ColumnToPileMove

public ColumnToPileMove(Column from,
                        Card movingCard,
                        Pile to)
Method Detail

valid

public boolean valid(Solitaire theGame)
Moves can determine their validity. Helper functions are used to make code more readable


sameSuit

protected boolean sameSuit(int suit)
Helper function to determine a "hypothetical card" is of the same suit as the to pile. This is called on a double click or solve attempt.


oneMore

protected boolean oneMore(int rank)
Helper function to determine a "hypothetical card" has a rank of one greater than the top card on the "to" pile. This is called on a double click or solve attempt.


aceOverKing

protected boolean aceOverKing(int rank)
Helper function to determine a "hypothetical card" is an Ace and if the top card on the "to" pile is a King. This is called on a double click or solve attempt.


doMove

public boolean doMove(Solitaire theGame)
Execute the move


undo

public boolean undo(Solitaire theGame)
Undo move (and score)