Yatzy/Domain/Player.java

44 lines
782 B
Java
Raw Normal View History

2024-05-02 11:26:21 +02:00
package Domain;
public class Player {
private String name;
private int[] tabelle;
public Player(String name){
this.name = name;
2024-05-02 12:46:36 +02:00
this.tabelle = new int[17];
2024-05-02 11:26:21 +02:00
}
//counts all the
public int getSumOne(){
int sum = 0;
for(int i = 0; i < 6; i++){
sum += tabelle[i];
}
return sum;
}
public int getSumTwo(){
int sum = 0;
2024-05-02 12:46:36 +02:00
for (int i = 7; i < 17; i++){
2024-05-02 11:26:21 +02:00
sum += tabelle[i];
}
return sum;
}
public int getSum(){
int sumOne = getSumOne();
int sumTwo = getSumTwo();
return sumOne += sumTwo;
}
2024-05-02 12:46:36 +02:00
public String toString(){
for (int i = 0; i < )
}
2024-05-02 11:26:21 +02:00
public String getName(){
return name;
}
}