diff options
Diffstat (limited to 'src/ch/epfl/maze/physical/Maze.java')
-rw-r--r-- | src/ch/epfl/maze/physical/Maze.java | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/ch/epfl/maze/physical/Maze.java b/src/ch/epfl/maze/physical/Maze.java index bff8791..51b9811 100644 --- a/src/ch/epfl/maze/physical/Maze.java +++ b/src/ch/epfl/maze/physical/Maze.java | |||
@@ -10,7 +10,6 @@ import java.util.List; | |||
10 | * | 10 | * |
11 | * @author Pacien TRAN-GIRARD | 11 | * @author Pacien TRAN-GIRARD |
12 | */ | 12 | */ |
13 | |||
14 | public final class Maze extends World { | 13 | public final class Maze extends World { |
15 | 14 | ||
16 | private final List<Animal> animals; | 15 | private final List<Animal> animals; |
@@ -21,7 +20,6 @@ public final class Maze extends World { | |||
21 | * | 20 | * |
22 | * @param labyrinth Structure of the labyrinth, an NxM array of tiles | 21 | * @param labyrinth Structure of the labyrinth, an NxM array of tiles |
23 | */ | 22 | */ |
24 | |||
25 | public Maze(int[][] labyrinth) { | 23 | public Maze(int[][] labyrinth) { |
26 | super(labyrinth); | 24 | super(labyrinth); |
27 | 25 | ||
@@ -46,7 +44,6 @@ public final class Maze extends World { | |||
46 | * @return <b>true</b> if the animal belongs to the world, <b>false</b> | 44 | * @return <b>true</b> if the animal belongs to the world, <b>false</b> |
47 | * otherwise. | 45 | * otherwise. |
48 | */ | 46 | */ |
49 | |||
50 | public boolean hasAnimal(Animal a) { | 47 | public boolean hasAnimal(Animal a) { |
51 | return this.animals.contains(a); | 48 | return this.animals.contains(a); |
52 | } | 49 | } |
@@ -56,7 +53,6 @@ public final class Maze extends World { | |||
56 | * | 53 | * |
57 | * @param a The animal to add | 54 | * @param a The animal to add |
58 | */ | 55 | */ |
59 | |||
60 | public void addAnimal(Animal a) { | 56 | public void addAnimal(Animal a) { |
61 | a.setPosition(this.getStart()); | 57 | a.setPosition(this.getStart()); |
62 | this.animals.add(a); | 58 | this.animals.add(a); |
@@ -67,7 +63,6 @@ public final class Maze extends World { | |||
67 | * | 63 | * |
68 | * @param a The animal to remove | 64 | * @param a The animal to remove |
69 | */ | 65 | */ |
70 | |||
71 | public void removeAnimal(Animal a) { | 66 | public void removeAnimal(Animal a) { |
72 | boolean contained = this.animals.remove(a); | 67 | boolean contained = this.animals.remove(a); |
73 | if (contained) this.animalHistory.add(a); | 68 | if (contained) this.animalHistory.add(a); |
@@ -80,4 +75,5 @@ public final class Maze extends World { | |||
80 | this.animalHistory.forEach(a -> this.addAnimal(a.copy())); | 75 | this.animalHistory.forEach(a -> this.addAnimal(a.copy())); |
81 | this.animalHistory.clear(); | 76 | this.animalHistory.clear(); |
82 | } | 77 | } |
78 | |||
83 | } | 79 | } |