| 1 | package io.github.mathieusoysal; | |
| 2 | ||
| 3 | import io.github.mathieusoysal.yatzy_mod.YatzyMod; | |
| 4 | ||
| 5 | /** | |
| 6 | * The {@code Yatzy} class provides static methods for calculating scores for | |
| 7 | * the Yatzy game. | |
| 8 | * | |
| 9 | * | |
| 10 | * @author MathieuSoysal | |
| 11 | */ | |
| 12 | public class Yatzy { | |
| 13 | ||
| 14 | private Yatzy() { | |
| 15 | } | |
| 16 | ||
| 17 | /** | |
| 18 | * Calculate the score for the given category {@code YatzyMod} based on the | |
| 19 | * given set of dice {@code Dices}. | |
| 20 | * | |
| 21 | * @param mod The category to calculate the score for. | |
| 22 | * @param dices The set of dice. | |
| 23 | * @return The calculated score for the given category. | |
| 24 | * @see YatzyMod#calculateScore(Dices) | |
| 25 | */ | |
| 26 | public static int calculateScore(YatzyMod mod, Dices dices) { | |
| 27 |
1
1. calculateScore : replaced int return with 0 for io/github/mathieusoysal/Yatzy::calculateScore → KILLED |
return mod.calculateScore(dices); |
| 28 | } | |
| 29 | ||
| 30 | /** | |
| 31 | * Calculate the score for the "Chance" category based on the given set of dice. | |
| 32 | * | |
| 33 | * @param dices The set of dice. | |
| 34 | * @return The calculated score for the "Chance" category. | |
| 35 | * @see YatzyMod#CHANCE | |
| 36 | */ | |
| 37 | public static int chance(Dices dices) { | |
| 38 |
1
1. chance : replaced int return with 0 for io/github/mathieusoysal/Yatzy::chance → KILLED |
return calculateScore(YatzyMod.CHANCE, dices); |
| 39 | } | |
| 40 | ||
| 41 | /** | |
| 42 | * Calculate the score for the "Yatzy" category based on the given set of dice. | |
| 43 | * | |
| 44 | * @param dices The set of dice. | |
| 45 | * @return The calculated score for the "Yatzy" category. | |
| 46 | * @see YatzyMod#YATZY | |
| 47 | */ | |
| 48 | public static int yatzy(Dices dices) { | |
| 49 |
1
1. yatzy : replaced int return with 0 for io/github/mathieusoysal/Yatzy::yatzy → KILLED |
return calculateScore(YatzyMod.YATZY, dices); |
| 50 | } | |
| 51 | ||
| 52 | /** | |
| 53 | * Calculate the score for the "Ones" category based on the given set of dice. | |
| 54 | * | |
| 55 | * @param dices The set of dice. | |
| 56 | * @return The calculated score for the "Ones" category. | |
| 57 | * @see YatzyMod#ONES | |
| 58 | */ | |
| 59 | public static int ones(Dices dices) { | |
| 60 |
1
1. ones : replaced int return with 0 for io/github/mathieusoysal/Yatzy::ones → KILLED |
return calculateScore(YatzyMod.ONES, dices); |
| 61 | } | |
| 62 | ||
| 63 | /** | |
| 64 | * Calculate the score for the "Twos" category based on the given set of dice. | |
| 65 | * | |
| 66 | * @param dices The set of dice. | |
| 67 | * @return The calculated score for the "Twos" category. | |
| 68 | * @see YatzyMod#TWOS | |
| 69 | */ | |
| 70 | public static int twos(Dices dices) { | |
| 71 |
1
1. twos : replaced int return with 0 for io/github/mathieusoysal/Yatzy::twos → KILLED |
return calculateScore(YatzyMod.TWOS, dices); |
| 72 | } | |
| 73 | ||
| 74 | /** | |
| 75 | * Calculate the score for the "Threes" category based on the given set of dice. | |
| 76 | * | |
| 77 | * @param dices The set of dice. | |
| 78 | * @return The calculated score for the "Threes" category. | |
| 79 | * @see YatzyMod#THREES | |
| 80 | */ | |
| 81 | public static int threes(Dices dices) { | |
| 82 |
1
1. threes : replaced int return with 0 for io/github/mathieusoysal/Yatzy::threes → KILLED |
return calculateScore(YatzyMod.THREES, dices); |
| 83 | } | |
| 84 | ||
| 85 | /** | |
| 86 | * Calculate the score for the "Fours" category based on the given set of dice. | |
| 87 | * | |
| 88 | * @param dices The set of dice. | |
| 89 | * @return The calculated score for the "Fours" category. | |
| 90 | * @see YatzyMod#FOURS | |
| 91 | */ | |
| 92 | public static int fours(Dices dices) { | |
| 93 |
1
1. fours : replaced int return with 0 for io/github/mathieusoysal/Yatzy::fours → KILLED |
return calculateScore(YatzyMod.FOURS, dices); |
| 94 | } | |
| 95 | ||
| 96 | /** | |
| 97 | * Calculate the score for the "Fives" category based on the given set of dice. | |
| 98 | * | |
| 99 | * @param dices The set of dice. | |
| 100 | * @return The calculated score for the "Fives" category. | |
| 101 | */ | |
| 102 | public static int fives(Dices dices) { | |
| 103 |
1
1. fives : replaced int return with 0 for io/github/mathieusoysal/Yatzy::fives → KILLED |
return calculateScore(YatzyMod.FIVES, dices); |
| 104 | } | |
| 105 | ||
| 106 | /** | |
| 107 | * Calculate the score for the "Sixes" category based on the given set of dice. | |
| 108 | * | |
| 109 | * @param dices The set of dice. | |
| 110 | * @return The calculated score for the "Sixes" category. | |
| 111 | * @see YatzyMod#SIXES | |
| 112 | */ | |
| 113 | public static int sixes(Dices dices) { | |
| 114 |
1
1. sixes : replaced int return with 0 for io/github/mathieusoysal/Yatzy::sixes → KILLED |
return calculateScore(YatzyMod.SIXES, dices); |
| 115 | } | |
| 116 | ||
| 117 | /** | |
| 118 | * Calculate the score for the "Pair" category based on the given set of dice. | |
| 119 | * | |
| 120 | * @param dices The set of dice. | |
| 121 | * @return The calculated score for the "Pair" category. | |
| 122 | * @see YatzyMod#PAIR | |
| 123 | */ | |
| 124 | public static int pair(Dices dices) { | |
| 125 |
1
1. pair : replaced int return with 0 for io/github/mathieusoysal/Yatzy::pair → KILLED |
return calculateScore(YatzyMod.PAIR, dices); |
| 126 | } | |
| 127 | ||
| 128 | /** | |
| 129 | * Calculate the score for the "Two Pairs" category based on the given set of | |
| 130 | * dice. | |
| 131 | * | |
| 132 | * @param dices The set of dice. | |
| 133 | * @return The calculated score for the "Two Pairs" category. | |
| 134 | */ | |
| 135 | public static int twoPairs(Dices dices) { | |
| 136 |
1
1. twoPairs : replaced int return with 0 for io/github/mathieusoysal/Yatzy::twoPairs → KILLED |
return calculateScore(YatzyMod.TWO_PAIRS, dices); |
| 137 | } | |
| 138 | ||
| 139 | /** | |
| 140 | * Calculate the score for the "Four of a Kind" category based on the given set | |
| 141 | * of dice. | |
| 142 | * | |
| 143 | * @param dices The set of dice. | |
| 144 | * @return The calculated score for the "Four of a Kind" category. | |
| 145 | */ | |
| 146 | public static int fourOfAKind(Dices dices) { | |
| 147 |
1
1. fourOfAKind : replaced int return with 0 for io/github/mathieusoysal/Yatzy::fourOfAKind → KILLED |
return calculateScore(YatzyMod.FOUR_OF_A_KIND, dices); |
| 148 | } | |
| 149 | ||
| 150 | /** | |
| 151 | * Calculate the score for the "Three of a Kind" category based on the given set | |
| 152 | * of dice. | |
| 153 | * | |
| 154 | * @param dices The set of dice. | |
| 155 | * @return The calculated score for the "Three of a Kind" category. | |
| 156 | * @see YatzyMod#THREE_OF_A_KIND | |
| 157 | */ | |
| 158 | public static int threeOfAKind(Dices dices) { | |
| 159 |
1
1. threeOfAKind : replaced int return with 0 for io/github/mathieusoysal/Yatzy::threeOfAKind → KILLED |
return calculateScore(YatzyMod.THREE_OF_A_KIND, dices); |
| 160 | } | |
| 161 | ||
| 162 | /** | |
| 163 | * Calculate the score for the "Small Straight" category based on the given set | |
| 164 | * of dice. | |
| 165 | * | |
| 166 | * @param dices The set of dice. | |
| 167 | * @return The calculated score for the "Small Straight" category. | |
| 168 | * @see YatzyMod#SMALL_STRAIGHT | |
| 169 | */ | |
| 170 | public static int smallStraight(Dices dices) { | |
| 171 |
1
1. smallStraight : replaced int return with 0 for io/github/mathieusoysal/Yatzy::smallStraight → KILLED |
return calculateScore(YatzyMod.SMALL_STRAIGHT, dices); |
| 172 | } | |
| 173 | ||
| 174 | /** | |
| 175 | * Calculate the score for the "Large Straight" category based on the given set | |
| 176 | * of dice. | |
| 177 | * | |
| 178 | * @param dices The set of dice. | |
| 179 | * @return The calculated score for the "Large Straight" category. | |
| 180 | * @see YatzyMod#LARGE_STRAIGHT | |
| 181 | */ | |
| 182 | public static int largeStraight(Dices dices) { | |
| 183 |
1
1. largeStraight : replaced int return with 0 for io/github/mathieusoysal/Yatzy::largeStraight → KILLED |
return calculateScore(YatzyMod.LARGE_STRAIGHT, dices); |
| 184 | } | |
| 185 | ||
| 186 | /** | |
| 187 | * Calculate the score for the "Full House" category based on the given set of | |
| 188 | * dice. | |
| 189 | * | |
| 190 | * @param dices The set of dice. | |
| 191 | * @return The calculated score for the "Full House" category. | |
| 192 | * @see YatzyMod#FULL_HOUSE | |
| 193 | */ | |
| 194 | public static int fullHouse(Dices dices) { | |
| 195 |
1
1. fullHouse : replaced int return with 0 for io/github/mathieusoysal/Yatzy::fullHouse → KILLED |
return calculateScore(YatzyMod.FULL_HOUSE, dices); |
| 196 | } | |
| 197 | } | |
Mutations | ||
| 27 |
1.1 |
|
| 38 |
1.1 |
|
| 49 |
1.1 |
|
| 60 |
1.1 |
|
| 71 |
1.1 |
|
| 82 |
1.1 |
|
| 93 |
1.1 |
|
| 103 |
1.1 |
|
| 114 |
1.1 |
|
| 125 |
1.1 |
|
| 136 |
1.1 |
|
| 147 |
1.1 |
|
| 159 |
1.1 |
|
| 171 |
1.1 |
|
| 183 |
1.1 |
|
| 195 |
1.1 |