public class Human extends Player
| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.Scanner |
scanner |
name, sumOfVisibleCards| Constructor and Description |
|---|
Human(java.lang.String name)
Constructs a Human object to represent the user.
|
| Modifier and Type | Method and Description |
|---|---|
private boolean |
getYesOrNo(java.lang.String question)
Returns a boolean response to a yes-no question.
|
(package private) boolean |
offerCard(Player[] players)
Asks the user whether to take another card.
|
(package private) void |
showVisibleCards(Player[] players)
Prints the sum of the visible cards for each player.
|
(package private) void |
takeHiddenCard(int card)
Takes a card that is not visible to the other players.
|
getScore, takeVisibleCardHuman(java.lang.String name)
name - The name of the user.boolean offerCard(Player[] players)
void takeHiddenCard(int card)
takeHiddenCard in class Playercard - The card taken.private boolean getYesOrNo(java.lang.String question)
question - The question to be asked.void showVisibleCards(Player[] players)
players - The array of Players.