summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ch/epfl/maze/physical/Maze.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ch/epfl/maze/physical/Maze.java b/src/ch/epfl/maze/physical/Maze.java
index e58a56a..bff8791 100644
--- a/src/ch/epfl/maze/physical/Maze.java
+++ b/src/ch/epfl/maze/physical/Maze.java
@@ -75,8 +75,9 @@ public final class Maze extends World {
75 75
76 @Override 76 @Override
77 public void reset() { 77 public void reset() {
78 for (Animal a : this.animals) this.removeAnimal(a); 78 this.animalHistory.addAll(this.animals);
79 for (Animal a : this.animalHistory) this.addAnimal(a.copy()); 79 this.animals.clear();
80 this.animalHistory.forEach(a -> this.addAnimal(a.copy()));
80 this.animalHistory.clear(); 81 this.animalHistory.clear();
81 } 82 }
82} 83}