public class Player
extends java.lang.Object
| Constructor and Description |
|---|
Player(int credit)
Constructor of Player that receives as argument the number of credits that player will
have at his disposal
|
| Modifier and Type | Method and Description |
|---|---|
int |
bet(int credits)
Retrieves credits
|
int |
getCredit()
Shows the credit of the player in a given moment
|
void |
receiveCards(Card[] cards)
Save cards passed by argument in player's hand
|
Card[] |
retrieveCards(int[] cards)
Retrieves cards from the player's hand that are at the positions indicated
|
Card[] |
showHand()
Shows the references of the cards present in player's hand
|
void |
win(int credit)
Adds a prize to player's account
|
private int credit
private Hand hand
public Player(int credit)
credit - Number of credits that the player has at the beginningpublic int getCredit()
public Card[] retrieveCards(int[] cards)
cards - positions of the cards that are to be retrievedpublic void receiveCards(Card[] cards)
cards - Cards to be savedpublic int bet(int credits)
credits - from player's accountpublic void win(int credit)
credit - Amount to add to player's accountpublic Card[] showHand()