|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectGameController
public class GameController
| Constructor Summary | |
|---|---|
GameController()
Creates a controller to play the Aces Up game. |
|
| Method Summary | |
|---|---|
void |
deal()
Adds a card from the deck to the end of each of the card lists if the deck is not empty. |
void |
discard(int listNum)
Moves the last card from the given list to the discard pile if the list is not empty and the last card has a rank that is greater than the last card on another list with the same suit. |
PlayingCard |
getCard(int listNum,
int index)
Gets the card in the specified list number at the given index. |
int |
getScore()
Gets the current score. |
void |
move(int listNum)
Move the last card from the given list (if the list is not empty) to an empty list if one exists. |
void |
startNewGame()
Moves all cards from the lists and discard pile back into the deck of cards, shuffles the deck and starts a new game. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GameController()
| Method Detail |
|---|
public PlayingCard getCard(int listNum,
int index)
listNum - The number of the desired card list between 0 and 3 inclusiveindex - The position of the card desired in the given list between 0 and the size of the list - 1
public int getScore()
public void deal()
public void discard(int listNum)
listNum - The number of the desired card list between 0 and 3 inclusivepublic void move(int listNum)
listNum - The number of the desired card list between 0 and 3 inclusivepublic void startNewGame()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||