Package io.github.mathieusoysal
Class Yatzy
java.lang.Object
io.github.mathieusoysal.Yatzy
The
Yatzy
class provides static methods for calculating scores for
the Yatzy game.- Author:
- MathieuSoysal
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
calculateScore
(YatzyMod mod, Dices dices) Calculate the score for the given categoryYatzyMod
based on the given set of diceDices
.static int
Calculate the score for the "Chance" category based on the given set of dice.static int
Calculate the score for the "Fives" category based on the given set of dice.static int
fourOfAKind
(Dices dices) Calculate the score for the "Four of a Kind" category based on the given set of dice.static int
Calculate the score for the "Fours" category based on the given set of dice.static int
Calculate the score for the "Full House" category based on the given set of dice.static int
largeStraight
(Dices dices) Calculate the score for the "Large Straight" category based on the given set of dice.static int
Calculate the score for the "Ones" category based on the given set of dice.static int
Calculate the score for the "Pair" category based on the given set of dice.static int
Calculate the score for the "Sixes" category based on the given set of dice.static int
smallStraight
(Dices dices) Calculate the score for the "Small Straight" category based on the given set of dice.static int
threeOfAKind
(Dices dices) Calculate the score for the "Three of a Kind" category based on the given set of dice.static int
Calculate the score for the "Threes" category based on the given set of dice.static int
Calculate the score for the "Two Pairs" category based on the given set of dice.static int
Calculate the score for the "Twos" category based on the given set of dice.static int
Calculate the score for the "Yatzy" category based on the given set of dice.
-
Method Details
-
calculateScore
Calculate the score for the given categoryYatzyMod
based on the given set of diceDices
.- Parameters:
mod
- The category to calculate the score for.dices
- The set of dice.- Returns:
- The calculated score for the given category.
- See Also:
-
chance
Calculate the score for the "Chance" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Chance" category.
- See Also:
-
yatzy
Calculate the score for the "Yatzy" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Yatzy" category.
- See Also:
-
ones
Calculate the score for the "Ones" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Ones" category.
- See Also:
-
twos
Calculate the score for the "Twos" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Twos" category.
- See Also:
-
threes
Calculate the score for the "Threes" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Threes" category.
- See Also:
-
fours
Calculate the score for the "Fours" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Fours" category.
- See Also:
-
fives
Calculate the score for the "Fives" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Fives" category.
-
sixes
Calculate the score for the "Sixes" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Sixes" category.
- See Also:
-
pair
Calculate the score for the "Pair" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Pair" category.
- See Also:
-
twoPairs
Calculate the score for the "Two Pairs" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Two Pairs" category.
-
fourOfAKind
Calculate the score for the "Four of a Kind" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Four of a Kind" category.
-
threeOfAKind
Calculate the score for the "Three of a Kind" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Three of a Kind" category.
- See Also:
-
smallStraight
Calculate the score for the "Small Straight" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Small Straight" category.
- See Also:
-
largeStraight
Calculate the score for the "Large Straight" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Large Straight" category.
- See Also:
-
fullHouse
Calculate the score for the "Full House" category based on the given set of dice.- Parameters:
dices
- The set of dice.- Returns:
- The calculated score for the "Full House" category.
- See Also:
-