diff options
author | Pacien TRAN-GIRARD | 2015-11-24 14:28:26 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2015-11-24 14:28:26 +0100 |
commit | e2354d82e09c3bf8ae472d174332670d2d12f9bb (patch) | |
tree | 92528b9231178fd47c6910163360413d4ae77256 /src/ch/epfl/maze/tests | |
parent | 5f9be99e7ebd4a90e666e6efbe9e9d4b3b8008e7 (diff) | |
download | maze-solver-e2354d82e09c3bf8ae472d174332670d2d12f9bb.tar.gz |
Use Set instead of array for Direction choices
Diffstat (limited to 'src/ch/epfl/maze/tests')
-rw-r--r-- | src/ch/epfl/maze/tests/AnimalTest.java | 6 | ||||
-rw-r--r-- | src/ch/epfl/maze/tests/GhostsTest.java | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/ch/epfl/maze/tests/AnimalTest.java b/src/ch/epfl/maze/tests/AnimalTest.java index 67c27e5..0b02442 100644 --- a/src/ch/epfl/maze/tests/AnimalTest.java +++ b/src/ch/epfl/maze/tests/AnimalTest.java | |||
@@ -6,10 +6,10 @@ import ch.epfl.maze.util.Vector2D; | |||
6 | import junit.framework.TestCase; | 6 | import junit.framework.TestCase; |
7 | import org.junit.Test; | 7 | import org.junit.Test; |
8 | 8 | ||
9 | import java.util.Set; | ||
10 | |||
9 | /** | 11 | /** |
10 | * Test case for {@code Animal} implementation. | 12 | * Test case for {@code Animal} implementation. |
11 | * | ||
12 | * @author EPFL | ||
13 | */ | 13 | */ |
14 | public class AnimalTest extends TestCase { | 14 | public class AnimalTest extends TestCase { |
15 | 15 | ||
@@ -79,7 +79,7 @@ public class AnimalTest extends TestCase { | |||
79 | } | 79 | } |
80 | 80 | ||
81 | @Override | 81 | @Override |
82 | public Direction move(Direction[] choices) { | 82 | public Direction move(Set<Direction> choices) { |
83 | return null; | 83 | return null; |
84 | } | 84 | } |
85 | 85 | ||
diff --git a/src/ch/epfl/maze/tests/GhostsTest.java b/src/ch/epfl/maze/tests/GhostsTest.java index 2195443..c6970b1 100644 --- a/src/ch/epfl/maze/tests/GhostsTest.java +++ b/src/ch/epfl/maze/tests/GhostsTest.java | |||
@@ -16,6 +16,8 @@ import ch.epfl.maze.util.Vector2D; | |||
16 | import junit.framework.TestCase; | 16 | import junit.framework.TestCase; |
17 | import org.junit.Test; | 17 | import org.junit.Test; |
18 | 18 | ||
19 | import java.util.Set; | ||
20 | |||
19 | /** | 21 | /** |
20 | * Test suite for ghosts implementation. | 22 | * Test suite for ghosts implementation. |
21 | * | 23 | * |
@@ -126,7 +128,7 @@ public class GhostsTest extends TestCase { | |||
126 | } | 128 | } |
127 | 129 | ||
128 | @Override | 130 | @Override |
129 | public Direction move(Direction[] choices, Daedalus daedalus) { | 131 | public Direction move(Set<Direction> choices, Daedalus daedalus) { |
130 | if (mMoves) { | 132 | if (mMoves) { |
131 | return getPosition().getX() % 2 == 0 ? Direction.RIGHT : Direction.LEFT; | 133 | return getPosition().getX() % 2 == 0 ? Direction.RIGHT : Direction.LEFT; |
132 | } | 134 | } |