public interface GinRummyPlayer
Modifier and Type | Method and Description |
---|---|
Card |
getDiscard()
Get the player's discarded card.
|
java.util.ArrayList<java.util.ArrayList<Card>> |
getFinalMelds()
At the end of each turn, this method is called and the player that cannot (or will not) end the round will return a null value.
|
void |
reportDiscard(int playerNum,
Card discardedCard)
Report that the given player has discarded a given card.
|
void |
reportDraw(int playerNum,
Card drawnCard)
Report that the given player has drawn a given card and, if known, what the card is.
|
void |
reportFinalMelds(int playerNum,
java.util.ArrayList<java.util.ArrayList<Card>> melds)
When an player has ended play and formed melds, the melds are reported to both players.
|
void |
reportScores(int[] scores)
Report current player scores, indexed by 0-based player number.
|
void |
startGame(int playerNum,
int startingPlayerNum,
Card[] cards)
Inform player of 0-based player number (0/1), starting player number (0/1), and dealt cards
|
boolean |
willDrawFaceUpCard(Card card)
Return whether or not player will draw the given face-up card on the draw pile.
|
void startGame(int playerNum, int startingPlayerNum, Card[] cards)
playerNum
- player's 0-based player number (0/1)startingPlayerNum
- starting player number (0/1)cards
- dealt cardsboolean willDrawFaceUpCard(Card card)
card
- face-up card on the draw pilevoid reportDraw(int playerNum, Card drawnCard)
playerNum
- - player drawing a carddrawnCard
- - the card drawn or null, depending on whether the card is known to the player or not, respectively.Card getDiscard()
void reportDiscard(int playerNum, Card discardedCard)
playerNum
- the discarding playerdiscardedCard
- the card that was discardedjava.util.ArrayList<java.util.ArrayList<Card>> getFinalMelds()
void reportFinalMelds(int playerNum, java.util.ArrayList<java.util.ArrayList<Card>> melds)
playerNum
- player that has revealed meldsmelds
- an ArrayList of ArrayLists of melded cardsvoid reportScores(int[] scores)
scores
- current player scores, indexed by 0-based player number