diff options
Diffstat (limited to 'src/ch/epfl/maze/physical/Maze.java')
-rw-r--r-- | src/ch/epfl/maze/physical/Maze.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ch/epfl/maze/physical/Maze.java b/src/ch/epfl/maze/physical/Maze.java index d3ba645..d3273c8 100644 --- a/src/ch/epfl/maze/physical/Maze.java +++ b/src/ch/epfl/maze/physical/Maze.java | |||
@@ -1,7 +1,7 @@ | |||
1 | package ch.epfl.maze.physical; | 1 | package ch.epfl.maze.physical; |
2 | 2 | ||
3 | import java.util.ArrayList; | 3 | import java.util.HashSet; |
4 | import java.util.List; | 4 | import java.util.Set; |
5 | 5 | ||
6 | /** | 6 | /** |
7 | * Maze in which an animal starts from a starting point and must find the exit. | 7 | * Maze in which an animal starts from a starting point and must find the exit. |
@@ -13,8 +13,8 @@ import java.util.List; | |||
13 | */ | 13 | */ |
14 | public final class Maze extends World { | 14 | public final class Maze extends World { |
15 | 15 | ||
16 | private final List<Animal> animals; | 16 | private final Set<Animal> animals; |
17 | private final List<Animal> animalHistory; | 17 | private final Set<Animal> animalHistory; |
18 | 18 | ||
19 | /** | 19 | /** |
20 | * Constructs a Maze with a labyrinth structure. | 20 | * Constructs a Maze with a labyrinth structure. |
@@ -24,8 +24,8 @@ public final class Maze extends World { | |||
24 | public Maze(int[][] labyrinth) { | 24 | public Maze(int[][] labyrinth) { |
25 | super(labyrinth); | 25 | super(labyrinth); |
26 | 26 | ||
27 | this.animals = new ArrayList<>(); | 27 | this.animals = new HashSet<>(); |
28 | this.animalHistory = new ArrayList<>(); | 28 | this.animalHistory = new HashSet<>(); |
29 | } | 29 | } |
30 | 30 | ||
31 | @Override | 31 | @Override |
@@ -34,8 +34,8 @@ public final class Maze extends World { | |||
34 | } | 34 | } |
35 | 35 | ||
36 | @Override | 36 | @Override |
37 | public List<Animal> getAnimals() { | 37 | public Set<Animal> getAnimalSet() { |
38 | return this.animals; | 38 | return new HashSet<>(this.animals); |
39 | } | 39 | } |
40 | 40 | ||
41 | /** | 41 | /** |