-
Notifications
You must be signed in to change notification settings - Fork 738
Expand file tree
/
Copy pathParticipant.java
More file actions
42 lines (32 loc) · 847 Bytes
/
Participant.java
File metadata and controls
42 lines (32 loc) · 847 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
35
36
37
38
39
40
41
42
package nextstep.ladder.domain.participant;
public class Participant {
private String name;
private int currentIndex;
private String result;
public Participant(String name, int currentIndex) {
this.name = name;
this.currentIndex = currentIndex;
}
public void moveLeft() {
currentIndex -= 1;
}
public void moveRight() {
currentIndex += 1;
}
public void insertResult(String[] results) {
result = results[currentIndex];
}
public String getName() {
return name;
}
public final int getCurrentIndex() {
return currentIndex;
}
public String getResult() {
return result;
}
@Override
public String toString() {
return "{name:" + name + "}" + "{currentPosition:" + currentIndex + "}" + "|";
}
}