1 package org.newdawn.slick.command;
2
3
4
5
6
7
8
9 public class KeyControl implements Control {
10
11 private final int keycode;
12
13
14
15
16
17
18 public KeyControl(int keycode) {
19 this.keycode = keycode;
20 }
21
22
23
24
25 @Override
26 public int hashCode() {
27 final int prime = 31;
28 int result = 1;
29 result = prime * result + keycode;
30 return result;
31 }
32
33
34
35
36 @Override
37 public boolean equals(Object obj) {
38 if (this == obj) {
39 return true;
40 }
41 if (obj == null) {
42 return false;
43 }
44 if (!(obj instanceof KeyControl)) {
45 return false;
46 }
47 KeyControl other = (KeyControl) obj;
48 if (keycode != other.keycode) {
49 return false;
50 }
51 return true;
52 }
53 }