2024-04-29 21:06:04 +02:00
|
|
|
package domain;
|
|
|
|
|
|
|
|
public class Player {
|
|
|
|
int playerNumber;
|
|
|
|
String name;
|
|
|
|
String color;
|
|
|
|
int score;
|
2024-05-04 21:06:05 +02:00
|
|
|
Sheet sheet;
|
2024-04-29 21:06:04 +02:00
|
|
|
|
|
|
|
public Player(int playerNumber, String name, String color, int score) {
|
|
|
|
this.playerNumber = playerNumber;
|
|
|
|
this.name = name;
|
|
|
|
this.color = color;
|
|
|
|
this.score = score;
|
2024-05-04 21:06:05 +02:00
|
|
|
this.sheet = new Sheet();
|
2024-04-29 21:06:04 +02:00
|
|
|
}
|
2024-04-29 21:17:51 +02:00
|
|
|
|
2024-05-04 21:06:05 +02:00
|
|
|
|
|
|
|
public void newSheet(){
|
|
|
|
this.sheet = new Sheet();
|
|
|
|
}
|
|
|
|
|
2024-05-06 17:19:11 +02:00
|
|
|
public Sheet getSheet(){
|
|
|
|
return this.sheet;
|
|
|
|
}
|
2024-05-04 21:06:05 +02:00
|
|
|
|
2024-04-29 21:17:51 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
String ANSI_RESET = "\u001B[0m";
|
|
|
|
String coloredName = String.format(this.color + this.name + ANSI_RESET);
|
2024-05-04 21:06:05 +02:00
|
|
|
// return String.format("Player %d: %s", this.playerNumber, coloredName);
|
|
|
|
return String.format("%s", coloredName);
|
2024-04-29 21:17:51 +02:00
|
|
|
}
|
2024-04-29 21:06:04 +02:00
|
|
|
}
|