forked from mastifikator/FantasyJavaPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEquipment.java
More file actions
77 lines (62 loc) · 1.59 KB
/
Copy pathEquipment.java
File metadata and controls
77 lines (62 loc) · 1.59 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
package Iterator;
import java.util.Iterator;
public class Equipment implements Iterable<EquipmentPart>{
private Helm helm;
private Body body;
private Gauntlets gauntlets;
private Boots boots;
private Pants pants;
private int partCount;
public Equipment(Helm helm, Body body, Gauntlets gauntlets, Boots boots, Pants pants) {
this.helm = helm;
this.body = body;
this.gauntlets = gauntlets;
this.boots = boots;
this.pants = pants;
partCount = 5;
}
public Equipment(Body body, Gauntlets gauntlets, Boots boots, Pants pants) {
this.body = body;
this.gauntlets = gauntlets;
this.boots = boots;
this.pants = pants;
partCount = 4;
}
public Equipment(Body body, Boots boots, Pants pants) {
this.body = body;
this.boots = boots;
this.pants = pants;
partCount = 3;
}
public Equipment(Body body, Pants pants) {
this.body = body;
this.pants = pants;
partCount = 2;
}
public Equipment(Body body) {
this.body = body;
partCount = 1;
}
public Helm getHelm() {
return helm;
}
public Body getBody() {
return body;
}
public Gauntlets getGauntlets() {
return gauntlets;
}
public Boots getBoots() {
return boots;
}
public Pants getPants() {
return pants;
}
public int getPartCount() {
return partCount;
}
@Override
public Iterator<EquipmentPart> iterator() {
return new ArmorIterator(this);
}
}