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