Refactored package-structure
Extracted Animated-interface
This commit is contained in:
34
src/main/java/se/urmo/game/util/MyPoint.java
Normal file
34
src/main/java/se/urmo/game/util/MyPoint.java
Normal file
@ -0,0 +1,34 @@
|
||||
package se.urmo.game.util;
|
||||
|
||||
public class MyPoint {
|
||||
public final double x;
|
||||
public final double y;
|
||||
|
||||
public MyPoint(double x, double y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MyPoint{" +
|
||||
"x=" + x +
|
||||
", y=" + y +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
MyPoint myPoint = (MyPoint) o;
|
||||
return Double.compare(x, myPoint.x) == 0 && Double.compare(y, myPoint.y) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = Double.hashCode(x);
|
||||
result = 31 * result + Double.hashCode(y);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user