|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCardPile
Foundation
public class Foundation
Foundation object, which holds a pile of cards, in order of increasing rank.
The extension of CardPile makes the class easier because now you can call all those methods without redoing all other methods
| Constructor Summary | |
|---|---|
Foundation()
|
|
| Method Summary | |
|---|---|
IGuiCard |
getVisibleCard(int index)
This method returns the top card of the foundation because only that card can ever be visible. |
boolean |
isAddable(Card card)
Overrides default isAddable method |
boolean |
isRemovable(Card card)
Overrides default isRemovable method Returns false, since you cannot remove from a foundation |
static void |
main(java.lang.String[] args)
Main method, checks whether there are bugs in class |
int |
maxVisibleCount()
A foundation can only have 1 card visible at most. |
int |
visibleCardCount()
A foundation has zero cards visible if it is empty, 1 if it is not. |
| Methods inherited from class CardPile |
|---|
addCard, clear, dealCard, forceAddCard, getCard, getMaxSize, getPileID, getSize, getSuit, isEmpty, isFull, isRemovable, isSameSuit, removeCard, setID, setMaxSize, setSuit, setView, update |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Foundation()
| Method Detail |
|---|
public boolean isAddable(Card card)
isAddable in interface ICardPileisAddable in class CardPilecard - - card to be added to the Foundation
public boolean isRemovable(Card card)
public static void main(java.lang.String[] args)
public int maxVisibleCount()
maxVisibleCount in interface IGuiPileModelmaxVisibleCount in class CardPilepublic int visibleCardCount()
visibleCardCount in interface IGuiPileModelvisibleCardCount in class CardPilepublic IGuiCard getVisibleCard(int index)
getVisibleCard in interface IGuiPileModelgetVisibleCard in class CardPileindex - specifies which visible card obtained from model
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||