29 lines
547 B
Java
29 lines
547 B
Java
package domain.sheets;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
public class StarWarsDay extends Category{
|
|
|
|
@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;
|
|
}
|
|
}
|