-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathType.java
More file actions
38 lines (33 loc) · 2.02 KB
/
Type.java
File metadata and controls
38 lines (33 loc) · 2.02 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
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Type {
private String type;
private static Map<Type, List<String>> superEffective = new HashMap<Type, List<String>>();
public Type(String type) {
this.type = type;
}
static {
superEffective.put(new Type("Bug"), new ArrayList<String>(Arrays.asList("Grass", "Dark", "Psychic")));
superEffective.put(new Type("Dark"), new ArrayList<String>(Arrays.asList("Ghost","Psychic")));
superEffective.put(new Type("Dragon"), new ArrayList<String>(Arrays.asList("Dragon")));
superEffective.put(new Type("Electric"), new ArrayList<String>(Arrays.asList("Flying", "Water")));
superEffective.put(new Type("Fairy"), new ArrayList<String>(Arrays.asList("Fighting", "Dark", "Dragon")));
superEffective.put(new Type("Fire"), new ArrayList<String>(Arrays.asList("Grass", "Bug", "Ice", "Steel")));
superEffective.put(new Type("Flying"), new ArrayList<String>(Arrays.asList("Bug", "Fighting", "Grass")));
superEffective.put(new Type("Ghost"), new ArrayList<String>(Arrays.asList("Ghost", "Psychic")));
superEffective.put(new Type("Grass"), new ArrayList<String>(Arrays.asList("Ground", "Rock", "Water")));
superEffective.put(new Type("Ground"), new ArrayList<String>(Arrays.asList("Electric", "Fire", "Poison", "Rock", "Steel")));
superEffective.put(new Type("Ice"), new ArrayList<String>(Arrays.asList("Dragon", "Flying", "Grass", "Ground")));
superEffective.put(new Type("Poison"), new ArrayList<String>(Arrays.asList("Fairy", "Grass")));
superEffective.put(new Type("Psychic"), new ArrayList<String>(Arrays.asList("Fighting", "Poison")));
superEffective.put(new Type("Rock"), new ArrayList<String>(Arrays.asList("Bug", "Fire", "Flying", "Ice")));
superEffective.put(new Type("Steel"), new ArrayList<String>(Arrays.asList("Fairy", "Ice", "Rock")));
superEffective.put(new Type("Water"), new ArrayList<String>(Arrays.asList("Fire", "Ground", "Rock")));
}
public String toString() {
return type;
}
}