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