-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAttackKey.java
More file actions
36 lines (30 loc) · 1.1 KB
/
Copy pathAttackKey.java
File metadata and controls
36 lines (30 loc) · 1.1 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
public class AttackKey {
private final String attackingMoveType;
private final String receivingPokemonType;
public AttackKey(String attackingMoveType, String receivingPokemonType) {
this.attackingMoveType = attackingMoveType;
this.receivingPokemonType = receivingPokemonType;
}
public String attackingMoveType() {
return attackingMoveType;
}
public String receivingPokemonType() {
return receivingPokemonType;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AttackKey that = (AttackKey) o;
return attackingMoveType.equals(that.attackingMoveType) &&
receivingPokemonType.equals(that.receivingPokemonType);
}
@Override
public int hashCode() {
return 31 * attackingMoveType.hashCode() + receivingPokemonType.hashCode();
}
@Override
public String toString() {
return "AttackKey[attackingMoveType=" + attackingMoveType + ", receivingPokemonType=" + receivingPokemonType + "]";
}
}