-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZombieTypes.java
More file actions
31 lines (25 loc) · 965 Bytes
/
ZombieTypes.java
File metadata and controls
31 lines (25 loc) · 965 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
import java.util.HashMap;
import java.util.Map;
public class ZombieTypes {
//Maps to hold the type of zombie and its related strength or weakness
//if this needed to be a evolving list of weakness/strengths changing the map to
//Map<String, ArrayList<String>> would be an easy to way do that.
public Map<String, String> weakness = new HashMap<>();
public Map<String, String> strengths = new HashMap<>();
//method to add a zombie and its weakness
public void addZombiesWeakness(String type, String weak) {
weakness.put(type, weak);
}
//method to add a zombie and its strength
public void addZombiesStrength(String type, String strong) {
strengths.put(type, strong);
}
//method to return weakness of zombie type
public String getWeakness(String type) {
return weakness.get(type);
}
//method to return strengt of a zombie type
public String getStrength(String type) {
return strengths.get(type);
}
}