-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.java
More file actions
34 lines (28 loc) · 888 Bytes
/
Copy pathPlayer.java
File metadata and controls
34 lines (28 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.util.Scanner;
public class Player {
private static final int STARTING_POSITION = 0;
private String name;
private Position position;
public Player(String name) {
this.name = name;
this.position = new Position(STARTING_POSITION);
}
public int play(Dice DICE) {
Scanner scanner = new Scanner(System.in);
System.out.println("\n\n" + name + "'s Previous Position: " + position.getPosition());
System.out.print("Press Enter to roll a Dice! ");
scanner.nextLine();
int diceValue = DICE.roll();
System.out.println("Dice Value: " + diceValue);
return diceValue;
}
public String getName() {
return name;
}
public Position getPosition() {
return position;
}
public void setPosition(Position position) {
this.position = position;
}
}