|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectFoundationPiles
public class FoundationPiles
This class manages Foundations via an array of four Foundation objects. All the other classes need to use are the constructor, clear (to restart the game) and addCard.
| Field Summary | |
|---|---|
static int |
NUM_FOUNDATIONS
|
| Constructor Summary | |
|---|---|
FoundationPiles()
default Constructor - makes an array of 4 Foundations with arbitrarily assigned suits |
|
| Method Summary | |
|---|---|
boolean |
addCard(Card card)
Method which adds card to corresponding foundation |
boolean |
allComplete()
Method for determining whether all foundations are complete |
void |
clear()
Method for starting a new game. |
Foundation |
getFoundation(int num)
Returns requested foundation |
java.util.ArrayList<Card> |
getHighCards()
Method which returns the high cards of the four foundations |
java.lang.String |
getSuit(int num)
Returns suit of foundation with index num |
boolean |
isAddable(Card card)
Method for determining whether card can be added to a foundation |
boolean |
isCardMovableToFound(Card toMove)
Checks if card toMove can be automatically moved to foundation |
static void |
main(java.lang.String[] args)
Main method, checks whether there are bugs in class |
void |
update()
Tells the view for each foundation model to update itself. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NUM_FOUNDATIONS
| Constructor Detail |
|---|
public FoundationPiles()
| Method Detail |
|---|
public void clear()
public Foundation getFoundation(int num)
public boolean isAddable(Card card)
public boolean allComplete()
public boolean addCard(Card card)
public java.util.ArrayList<Card> getHighCards()
public boolean isCardMovableToFound(Card toMove)
toMove - is card to be moved
public java.lang.String getSuit(int num)
public void update()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||