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