33 lines
628 B
Java
33 lines
628 B
Java
package Domain;
|
|
|
|
public class Fours extends Category{
|
|
|
|
private Player player;
|
|
|
|
public Fours(Player player) {
|
|
super("Fours", "Score of all the fours rolled.");
|
|
this.player = player;
|
|
}
|
|
|
|
@Override
|
|
public boolean correctCategory(int[] values){
|
|
for(int i : values){
|
|
if(i == 4){
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public int getScore(int[] values){
|
|
int score = 0;
|
|
for(int i : values){
|
|
if( i == 4 ){
|
|
score += 4;
|
|
}
|
|
}
|
|
return score;
|
|
}
|
|
}
|