-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathState.java
More file actions
42 lines (32 loc) · 765 Bytes
/
Copy pathState.java
File metadata and controls
42 lines (32 loc) · 765 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 application;
import java.util.Arrays;
public class State {
private int position;
private String[] state;
public State(int position, String[] state) {
this.position = position;
this.state = state;
}
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
public String[] getState() {
return state;
}
public void setState(String[] state) {
this.state = state;
}
public String getStateIndex(int i) {
return state[i];
}
public void changeState(int i, String player) {
state[i] = player;
}
@Override
public String toString() {
return "State{" + "position=" + position + ", state=" + Arrays.toString(state) + '}';
}
}