summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/model/Position.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/model/Position.java')
-rw-r--r--src/jrummikub/model/Position.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/jrummikub/model/Position.java b/src/jrummikub/model/Position.java
index 7396120..47c6c89 100644
--- a/src/jrummikub/model/Position.java
+++ b/src/jrummikub/model/Position.java
@@ -7,8 +7,8 @@ package jrummikub.model;
public class Position {
- private float x;
- private float y;
+ private double x;
+ private double y;
/**
* Create a new position by specifying the coordinates
@@ -18,7 +18,7 @@ public class Position {
* @param y
* y coordinate
*/
- public Position(float x, float y) {
+ public Position(double x, double y) {
this.x = x;
this.y = y;
}
@@ -28,7 +28,7 @@ public class Position {
*
* @return x coordinate
*/
- public float getX() {
+ public double getX() {
return x;
}
@@ -37,7 +37,7 @@ public class Position {
*
* @return y coordinate
*/
- public float getY() {
+ public double getY() {
return y;
}
@@ -55,9 +55,9 @@ public class Position {
if (getClass() != obj.getClass())
return false;
Position other = (Position) obj;
- if (Float.floatToIntBits(x) != Float.floatToIntBits(other.x))
+ if (Double.doubleToLongBits(x) != Double.doubleToLongBits(other.x))
return false;
- if (Float.floatToIntBits(y) != Float.floatToIntBits(other.y))
+ if (Double.doubleToLongBits(y) != Double.doubleToLongBits(other.y))
return false;
return true;
}
@@ -66,8 +66,8 @@ public class Position {
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + Float.floatToIntBits(x);
- result = prime * result + Float.floatToIntBits(y);
+ result = (int) (prime * result + Double.doubleToLongBits(x));
+ result = (int) (prime * result + Double.doubleToLongBits(y));
return result;
}