30 lines
553 B
Java
30 lines
553 B
Java
package Domain;
|
|
|
|
public class Fives extends Category{
|
|
|
|
public Fives() {
|
|
super("Fives", "Score of all the fives rolled.");
|
|
}
|
|
|
|
@Override
|
|
public boolean correctCategory(int[] values){
|
|
for(int i : values){
|
|
if(i == 5){
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public int getScore(int[] values){
|
|
int score = 0;
|
|
for(int i : values){
|
|
if( i == 5 ){
|
|
score += 5;
|
|
}
|
|
}
|
|
return score;
|
|
}
|
|
}
|