56 lines
1.1 KiB
Java
56 lines
1.1 KiB
Java
package domain;
|
|
|
|
public class Player {
|
|
int playerNumber;
|
|
String name;
|
|
String color;
|
|
int score;
|
|
Sheet sheet;
|
|
|
|
public Player(int playerNumber, String name, String color, int score, String gamemode) {
|
|
this.playerNumber = playerNumber;
|
|
this.name = name;
|
|
this.color = color;
|
|
this.score = score;
|
|
this.sheet = new Sheet();
|
|
|
|
if (gamemode.equals("default")){
|
|
this.sheet = new Sheet();
|
|
}
|
|
else if (gamemode.equals("starwars")){
|
|
this.sheet = new StarwarsSheet();
|
|
}
|
|
}
|
|
|
|
|
|
public void newSheet(){
|
|
this.sheet = new Sheet();
|
|
}
|
|
|
|
public Sheet getSheet(){
|
|
return this.sheet;
|
|
}
|
|
|
|
|
|
public void setScore(int score){
|
|
this.score = score;
|
|
}
|
|
|
|
public int getScore(){
|
|
return this.score;
|
|
}
|
|
|
|
|
|
public String getName(){
|
|
return this.name;
|
|
}
|
|
|
|
|
|
@Override
|
|
public String toString() {
|
|
String ANSI_RESET = "\u001B[0m";
|
|
String coloredName = String.format(this.color + this.name + ANSI_RESET);
|
|
return String.format("%s", coloredName);
|
|
}
|
|
}
|