diff options
Diffstat (limited to 'src/ch/epfl/maze')
-rw-r--r-- | src/ch/epfl/maze/util/Vector2D.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ch/epfl/maze/util/Vector2D.java b/src/ch/epfl/maze/util/Vector2D.java index 66b0216..407851c 100644 --- a/src/ch/epfl/maze/util/Vector2D.java +++ b/src/ch/epfl/maze/util/Vector2D.java | |||
@@ -9,6 +9,8 @@ public final class Vector2D { | |||
9 | /* shift constant to compute the hash */ | 9 | /* shift constant to compute the hash */ |
10 | private static final int SHIFT = 1000; | 10 | private static final int SHIFT = 1000; |
11 | 11 | ||
12 | private static final int ZERO = 0; | ||
13 | |||
12 | /* 2-dimension coordinates */ | 14 | /* 2-dimension coordinates */ |
13 | private final int mX, mY; | 15 | private final int mX, mY; |
14 | 16 | ||
@@ -25,6 +27,13 @@ public final class Vector2D { | |||
25 | } | 27 | } |
26 | 28 | ||
27 | /** | 29 | /** |
30 | * Constructs a 2-dimensional zero vector. | ||
31 | */ | ||
32 | public Vector2D() { | ||
33 | this(Vector2D.ZERO, Vector2D.ZERO); | ||
34 | } | ||
35 | |||
36 | /** | ||
28 | * Adds two coordinates to the vector. | 37 | * Adds two coordinates to the vector. |
29 | * | 38 | * |
30 | * @param x Horizontal coordinate to add | 39 | * @param x Horizontal coordinate to add |