com.blackledge.david.game.solitaire
Class SolitairePlayStack
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector
com.blackledge.david.game.solitaire.CardStack
com.blackledge.david.game.solitaire.SolitairePlayStack
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable, Collection, List, RandomAccess
public class SolitairePlayStack
- extends CardStack
A CardStack
that is used as an intermediate location for cards while
trying to get them to the goal location in Solitaire.
- Version:
- $Revision: 1.1 $
- See Also:
- Serialized Form
Methods inherited from class java.util.Vector |
add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
SolitairePlayStack
public SolitairePlayStack()
SolitairePlayStack
public SolitairePlayStack(Collection list)
canStack
public boolean canStack(Card card)
- Description copied from class:
CardStack
- Override for stacks with rules.
- Overrides:
canStack
in class CardStack
- Parameters:
card
- the card that wants to be stacked on top of this instance.
- Returns:
- true if the stack is empty and the card is a King, or the card's
suit color is opposite of this stack's top card and the card's
value is one less than the top card.
canPickUp
public boolean canPickUp(int i)
- Description copied from class:
CardStack
- Determine if we are allowed to call
CardStack.pickUp(int)
without getting a null back.
- Overrides:
canPickUp
in class CardStack
- Returns:
- true if the identified card exists and is face up.