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