| 1 | package io.github.mathieusoysal.yatzy_mod; | |
| 2 | ||
| 3 | import io.github.mathieusoysal.Dices; | |
| 4 | ||
| 5 | /** | |
| 6 | * The {@code YMOnes} class represents the "Ones" category in the Yatzy game. | |
| 7 | * | |
| 8 | * <p> | |
| 9 | * In the "Ones" category, the player scores the sum of the dice that show | |
| 10 | * the number one. | |
| 11 | * </p> | |
| 12 | * | |
| 13 | * @author MathieuSoysal | |
| 14 | * @see YatzyModInterface | |
| 15 | * @see YatzyModUtils | |
| 16 | */ | |
| 17 | class YMOnes implements YatzyModInterface { | |
| 18 | ||
| 19 | /** | |
| 20 | * Calculates the score for the "Ones" category based on the sum of dice | |
| 21 | * values that show the number one. | |
| 22 | * | |
| 23 | * @param dices The set of dice to calculate the score for. | |
| 24 | * @return The calculated score, which is the sum of dice values that show the | |
| 25 | * number one. | |
| 26 | * @see YatzyModUtils#filterAndSum(int, Dices) | |
| 27 | */ | |
| 28 | @Override | |
| 29 | public int calculateScore(Dices dices) { | |
| 30 |
1
1. calculateScore : replaced int return with 0 for io/github/mathieusoysal/yatzy_mod/YMOnes::calculateScore → KILLED |
return YatzyModUtils.filterAndSum(1, dices); |
| 31 | } | |
| 32 | } | |
Mutations | ||
| 30 |
1.1 |