| Modifier and Type | Field and Description |
|---|---|
private int |
actualBet |
private Deck |
deck |
private PlayVariant |
variant |
| Constructor and Description |
|---|
Game(PlayVariant variant)
Constructor of Game in which deck is initialized as default
|
Game(PlayVariant variant,
java.util.ArrayList<Card> cards)
Constructor of Game in which a list of cards is supplied
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
advice(Card[] cards)
For a given hand, retrieves the cards that should be held in order to achieve the maximum
gain (greedy way)
|
Card[] |
deal(int credits)
Receives certain amount and retrieves five cards
|
java.lang.String |
evaluateHand(Card[] cards)
Returns the name of the awarded hand by asking what is it to its variant,
if it exists, otherwise returns null
|
java.util.Map<java.lang.String,java.lang.Integer> |
getStats()
Retrieves the statistics by asking which are they to its variant
|
int |
getWins(java.lang.String nameOfHand)
Retrieves the prize for a given awarded hand by asking it to its variant
|
void |
prepareRound()
Orders the deck to shuffle
|
void |
receiveCards(Card[] cards)
Puts the received cards in deck
|
Card[] |
retrieveCards(int n)
Retrieves cards from deck
|
private PlayVariant variant
private Deck deck
private int actualBet
public Game(PlayVariant variant, java.util.ArrayList<Card> cards)
variant - Variant of Poker that fully specifies the details of its strategy and gainscards - List of cards to initialize the deckpublic Game(PlayVariant variant)
variant - Variant of Poker that fully specifies the details of its strategy and gainspublic int[] advice(Card[] cards)
public Card[] deal(int credits)
public java.util.Map<java.lang.String,java.lang.Integer> getStats()
public java.lang.String evaluateHand(Card[] cards)
evaluateHand in interface Playcards - Vector of cards (in number of 5) that are to be consideredpublic int getWins(java.lang.String nameOfHand)
public Card[] retrieveCards(int n)
retrieveCards in interface Playn - Number of cards to retrievepublic void receiveCards(Card[] cards)
receiveCards in interface Playcards - Cards that are to be put in deckpublic void prepareRound()
prepareRound in interface Play