mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-11 20:55:40 -08:00
Spaces tend to cause annoyances in a Unix-style shell environment. This change fixes that.
28 lines
416 B
Java
28 lines
416 B
Java
/**
|
|
* A Player in the game - consists of name and score
|
|
*
|
|
*/
|
|
public class Player {
|
|
|
|
private final String name;
|
|
|
|
private int score;
|
|
|
|
Player(String name) {
|
|
this.name = name;
|
|
this.score = 0;
|
|
}
|
|
|
|
public void addScore(int score) {
|
|
this.score += score;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public int getScore() {
|
|
return score;
|
|
}
|
|
}
|