diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/fr/umlv/java/wallj/board/Board.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/board/Board.java b/src/main/java/fr/umlv/java/wallj/board/Board.java index c846fd3..015a4c0 100644 --- a/src/main/java/fr/umlv/java/wallj/board/Board.java +++ b/src/main/java/fr/umlv/java/wallj/board/Board.java | |||
@@ -3,6 +3,8 @@ package fr.umlv.java.wallj.board; | |||
3 | import fr.umlv.java.wallj.model.BlockType; | 3 | import fr.umlv.java.wallj.model.BlockType; |
4 | import fr.umlv.java.wallj.utils.Matrix; | 4 | import fr.umlv.java.wallj.utils.Matrix; |
5 | 5 | ||
6 | import java.util.Arrays; | ||
7 | |||
6 | /** | 8 | /** |
7 | * An immutable BlockType matrix. | 9 | * An immutable BlockType matrix. |
8 | * | 10 | * |
@@ -65,4 +67,17 @@ public final class Board { | |||
65 | return TileVec2.of(Matrix.getWidth(map), Matrix.getHeight(map)); | 67 | return TileVec2.of(Matrix.getWidth(map), Matrix.getHeight(map)); |
66 | } | 68 | } |
67 | 69 | ||
70 | @Override | ||
71 | public boolean equals(Object o) { | ||
72 | if (this == o) return true; | ||
73 | if (!(o instanceof Board)) return false; | ||
74 | Board board = (Board) o; | ||
75 | return Arrays.deepEquals(map, board.map); | ||
76 | } | ||
77 | |||
78 | @Override | ||
79 | public int hashCode() { | ||
80 | return Arrays.hashCode(map); | ||
81 | } | ||
82 | |||
68 | } | 83 | } |