public class Cell extends CardStack
Constructor and Description |
---|
Cell() |
Modifier and Type | Method and Description |
---|---|
boolean |
playTo(Card card)
Given a card to be played to the top of this card stack, either make the legal play and return true, or throw an appropriate Exception.
|
addCard, canPlayFrom, getTopCard, isEmpty, playTo, removeTopCard, size, toArray, toString
public boolean playTo(Card card) throws java.lang.NullPointerException, IllegalPlayException
playTo
in class CardStack
card
- card to be played onto this card stackjava.lang.NullPointerException
- thrown if given Card parameter is nullIllegalPlayException
- thrown if "Cells may only contain a single card."