|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectoop2.setGame.SetGame
Implements the primary logic for the Set Game
| Constructor Summary | |
SetGame()
Construct a new SetGame with no cards on the table |
|
| Method Summary | |
void |
add(Card c)
Adds a card to the table. |
void |
clearCardsOnTable()
Removes all cards from the table. |
List |
findSet()
Checks to see if there is a set within the cards currently on the table. |
static List |
generateDeck()
Generates a randomly sorted deck of Set cards and returns it. |
int |
getCardCount()
Get the number of cards on the table. |
List |
getCardsOnTable()
Returns a list of the cards on the table. |
static boolean |
isSet(Card c1,
Card c2,
Card c3)
Checks to see if three cards form a set |
void |
removeCards(List cardsToRemove)
Removes the specificied cards from the table. |
void |
setCardsOnTable(List cardList)
Sets the cards on the table to be those in the cardList. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SetGame()
| Method Detail |
public List getCardsOnTable()
public void setCardsOnTable(List cardList)
cardList - The new list of cards on the table.public void clearCardsOnTable()
getCardsOnTable should be empty.
public void add(Card c)
public int getCardCount()
getCardsOnTable.size()
public void removeCards(List cardsToRemove)
cardsToRemove - -
Cards to be removed from the label.
IllegalArgumentException - -
if a card to be removed is not on the table.public List findSet()
public static List generateDeck()
Randomand/or Collectionsclasses
will be useful to you in randomly sorting/shuffling a deck of cards.
public static boolean isSet(Card c1,
Card c2,
Card c3)
c1 - -
First cardc2 - -
Second cardc3 - -
Third card
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||