-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSpace.java
64 lines (48 loc) · 1.2 KB
/
Space.java
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
public class Space {
private boolean hasWumpus = false;
private boolean hasHole = false;
private boolean hasObstacle = false;
private boolean hasGold = false;
private boolean filled = false;
public Space() {
}
public boolean isHasWumpus() {
return hasWumpus;
}
public void toggleWumpus() {
if (hasWumpus == true) {
hasWumpus = false;
filled = false;
} else {
hasWumpus = true;
filled = true;
}
}
public boolean isHasHole() {
return hasHole;
}
public void setHasHole(boolean hasHole) {
this.filled = true;
this.hasHole = hasHole;
}
public boolean isHasObstacle() {
return hasObstacle;
}
public void setHasObstacle(boolean hasObstacle) {
this.filled = true;
this.hasObstacle = hasObstacle;
}
public boolean isHasGold() {
return hasGold;
}
public void setHasGold(boolean hasGold) {
this.filled = true;
this.hasGold = hasGold;
}
public boolean isFilled() {
return filled;
}
public void setFilled(boolean filled) {
this.filled = filled;
}
}