java.lang.Object
cz.matfyz.rudad.joker.calculator.Calculator
The main class that performs the odds calculations for the Joker calculator application.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
-
Constructor Summary
ConstructorsConstructorDescriptionCalculator
(CalculatorArgs args) Creates a Calculator object based on the specified CalculatorArgs object.Calculator
(List<Player> players) Creates a Calculator object with the specified players.Calculator
(List<Player> players, ArrayList<Card> board) Creates a Calculator object with the specified players and board cards.Calculator
(List<Player> players, List<Card> deadCards) Creates a Calculator object with the specified players and dead cards.Creates a Calculator object with the specified players, board cards, and dead cards. -
Method Summary
Modifier and TypeMethodDescriptionPerforms the calculation of the probabilities of winning and tying for each player.Card[]
getBoard()
Returns the array of board cards in the calculator.Card[]
Returns the array of dead cards in the calculator.Player[]
Returns the array of players in the calculator.static void
The entry point for the Joker Calculator application.void
Prints a summary of the odds of winning and tying for each player.
-
Field Details
-
MIN_PLAYERS
static final int MIN_PLAYERS- See Also:
-
MAX_PLAYERS
static final int MAX_PLAYERS- See Also:
-
MAX_DEAD_CARDS
static final int MAX_DEAD_CARDS- See Also:
-
PRE_FLOP
static final int PRE_FLOP- See Also:
-
FLOP
static final int FLOP- See Also:
-
TURN
static final int TURN- See Also:
-
RIVER
static final int RIVER- See Also:
-
-
Constructor Details
-
Calculator
Creates a Calculator object with the specified players.- Parameters:
players
- the list of players- Throws:
IllegalArgumentException
- if the number of players is invalid
-
Calculator
Creates a Calculator object with the specified players and board cards.- Parameters:
players
- the list of playersboard
- the list of board cards- Throws:
IllegalArgumentException
- if the number of players or board cards is invalid
-
Calculator
Creates a Calculator object with the specified players and dead cards.- Parameters:
players
- the list of playersdeadCards
- the list of dead cards- Throws:
IllegalArgumentException
- if the number of players or dead cards is invalid
-
Calculator
Creates a Calculator object based on the specified CalculatorArgs object.- Parameters:
args
- the CalculatorArgs object containing the command-line arguments- Throws:
IllegalArgumentException
- if the arguments are invalid
-
Calculator
public Calculator(List<Player> players, List<Card> board, List<Card> deadCards) throws IllegalArgumentException Creates a Calculator object with the specified players, board cards, and dead cards.- Parameters:
players
- the list of playersboard
- the list of board cardsdeadCards
- the list of dead cards- Throws:
IllegalArgumentException
- if the number of players, board cards, or dead cards is invalid, or if the cards are not unique
-
-
Method Details
-
main
The entry point for the Joker Calculator application.- Parameters:
args
- the command-line arguments
-
getPlayers
Returns the array of players in the calculator.- Returns:
- an array of players
-
getBoard
Returns the array of board cards in the calculator.- Returns:
- an array of board cards
-
getDeadCards
Returns the array of dead cards in the calculator.- Returns:
- an array of dead cards
-
calculate
Performs the calculation of the probabilities of winning and tying for each player.- Returns:
- the Calculator object for method chaining
- Throws:
IllegalStateException
- if the number of board cards is invalid
-
printOdds
public void printOdds()Prints a summary of the odds of winning and tying for each player.
-