-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNyumba.java
More file actions
37 lines (32 loc) · 724 Bytes
/
Nyumba.java
File metadata and controls
37 lines (32 loc) · 724 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
public class Nyumba extends Pit {
private boolean safari;
public boolean tax() {
if(!isFunctional()) {
return false;
} else {
super.addSeeds(-2);
return true;
}
}
public Nyumba(int seeds) {
super(seeds);
safari = false;
}
public Nyumba() {
super();
safari = false;
}
public boolean isFunctional() {
if(!safari && super.getSeeds() > 5) {
return true;
}
return false;
}
public int setSeeds(int seeds) {
int ret = super.setSeeds(seeds);
if(seeds == 0) {
safari = true;
}
return ret;
}
}