2024-05-06 22:55:58 +02:00
|
|
|
package domain.sheets;
|
|
|
|
|
2024-05-07 01:10:14 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
|
2024-05-06 22:55:58 +02:00
|
|
|
public class StarWarsDay extends Category{
|
|
|
|
|
2024-05-07 01:10:14 +02:00
|
|
|
@Override
|
|
|
|
public void calcValueFromRoll(ArrayList<Integer> rolls) {
|
|
|
|
int amountFours = 0;
|
|
|
|
int amountFives = 0;
|
|
|
|
|
|
|
|
for (int roll : rolls){
|
|
|
|
if (roll == 4){
|
|
|
|
amountFours ++;
|
|
|
|
}
|
|
|
|
if (roll == 5){
|
|
|
|
amountFives++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int sum = 0;
|
|
|
|
|
|
|
|
sum += (amountFours) * 4;
|
|
|
|
sum += (amountFives) * 5;
|
|
|
|
|
|
|
|
this.value = sum;
|
|
|
|
}
|
2024-05-06 22:55:58 +02:00
|
|
|
}
|