public abstract class Match
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Match.States |
| Modifier and Type | Field and Description |
|---|---|
protected int |
actualBet |
protected Card[] |
discarded |
protected Play |
game |
protected int |
initialCredit |
protected Player |
player |
| Constructor and Description |
|---|
Match(int credits)
Constructor of Match that creates a default deck
|
Match(int credits,
java.util.ArrayList<Card> cards)
Constructor of Match that receives the cards to be loaded into deck
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
advice()
Advises the user about the cards he should hold according to the implemented strategy
|
boolean |
bet(int amount)
Performs a bet, meaning that the amount specified by amount is credited from player's
account
|
int |
credit()
Shows the player's actual credit
|
java.lang.String |
deal()
Performs the deal, which means that the amount bet is sent to the game and five cards
are retrieved from it
|
java.lang.String |
getStats()
Retrieves the statistics of the actual game until the moment
|
java.lang.String |
hold(int[] positions)
Holds the cards at the specified positions, discards those that are not to hold, retrieves
more from the game to replace them, retrieves and evaluates the final hand and gives
the player its prize (even if zero) and finally, gives back to game all the cards.
|
protected Play game
protected Player player
protected Card[] discarded
protected int actualBet
protected int initialCredit
public Match(int credits)
credits - Amount of credits in the beginningpublic Match(int credits,
java.util.ArrayList<Card> cards)
credits - Amount of credits in the beginningcards - Cards to be loaded into deckpublic boolean bet(int amount)
amount - Amount to betpublic java.lang.String deal()
public java.lang.String hold(int[] positions)
positions - Positions of the cards that are to maintainpublic int credit()
public int[] advice()
public java.lang.String getStats()