diff options
author | Pacien TRAN-GIRARD | 2015-11-24 11:11:17 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2015-11-24 11:11:17 +0100 |
commit | bc477506342411e9156b3230d847cb92bcb8e5f9 (patch) | |
tree | d952a5d14dccef38bfba3f8e27bfe10ea65d446a /src/ch/epfl/maze/graphics/Animation.java | |
parent | 903553fe9e03e4af75eb7f8547e08b480bc58ec4 (diff) | |
download | maze-solver-bc477506342411e9156b3230d847cb92bcb8e5f9.tar.gz |
Reformat code
Diffstat (limited to 'src/ch/epfl/maze/graphics/Animation.java')
-rw-r--r-- | src/ch/epfl/maze/graphics/Animation.java | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/ch/epfl/maze/graphics/Animation.java b/src/ch/epfl/maze/graphics/Animation.java index ce80c78..a00b6b2 100644 --- a/src/ch/epfl/maze/graphics/Animation.java +++ b/src/ch/epfl/maze/graphics/Animation.java | |||
@@ -22,7 +22,6 @@ import java.util.TreeMap; | |||
22 | * | 22 | * |
23 | * @author Pacien TRAN-GIRARD | 23 | * @author Pacien TRAN-GIRARD |
24 | */ | 24 | */ |
25 | |||
26 | public final class Animation { | 25 | public final class Animation { |
27 | 26 | ||
28 | /** | 27 | /** |
@@ -62,7 +61,6 @@ public final class Animation { | |||
62 | * @param animals The {@code List} of animals that will be shown on the first | 61 | * @param animals The {@code List} of animals that will be shown on the first |
63 | * frame | 62 | * frame |
64 | */ | 63 | */ |
65 | |||
66 | public Animation(List<Animal> animals) { | 64 | public Animation(List<Animal> animals) { |
67 | mGraphMap = new TreeMap<Integer, GraphicComponent>(); | 65 | mGraphMap = new TreeMap<Integer, GraphicComponent>(); |
68 | mImages = new HashMap<String, BufferedImage>(); | 66 | mImages = new HashMap<String, BufferedImage>(); |
@@ -94,7 +92,6 @@ public final class Animation { | |||
94 | * @param id Unique identifier for animal | 92 | * @param id Unique identifier for animal |
95 | * @param action Action that animal needs to perform | 93 | * @param action Action that animal needs to perform |
96 | */ | 94 | */ |
97 | |||
98 | public void update(Animal animal, int id, Action action) { | 95 | public void update(Animal animal, int id, Action action) { |
99 | // sanity checks | 96 | // sanity checks |
100 | if (action == null) { | 97 | if (action == null) { |
@@ -123,7 +120,6 @@ public final class Animation { | |||
123 | * | 120 | * |
124 | * @param id Identifier of animal to kill | 121 | * @param id Identifier of animal to kill |
125 | */ | 122 | */ |
126 | |||
127 | public void updateDying(int id) { | 123 | public void updateDying(int id) { |
128 | GraphicComponent graphComp = mGraphMap.get(id); | 124 | GraphicComponent graphComp = mGraphMap.get(id); |
129 | if (graphComp != null) { | 125 | if (graphComp != null) { |
@@ -135,7 +131,6 @@ public final class Animation { | |||
135 | * Notifies the animation that updates were done, and that it can start | 131 | * Notifies the animation that updates were done, and that it can start |
136 | * animating from now. | 132 | * animating from now. |
137 | */ | 133 | */ |
138 | |||
139 | public void doneUpdating() { | 134 | public void doneUpdating() { |
140 | mDone = false; | 135 | mDone = false; |
141 | } | 136 | } |
@@ -149,7 +144,6 @@ public final class Animation { | |||
149 | * @param targetWindow The window on which the graphic components will be painted | 144 | * @param targetWindow The window on which the graphic components will be painted |
150 | * (assumed non-null) | 145 | * (assumed non-null) |
151 | */ | 146 | */ |
152 | |||
153 | public void paint(float dt, Graphics2D g, ImageObserver targetWindow) { | 147 | public void paint(float dt, Graphics2D g, ImageObserver targetWindow) { |
154 | mRatio += dt; | 148 | mRatio += dt; |
155 | if (mRatio > 1) { | 149 | if (mRatio > 1) { |
@@ -181,7 +175,6 @@ public final class Animation { | |||
181 | * | 175 | * |
182 | * @return <b>true</b> if the animation is done, <b>false</b> otherwise | 176 | * @return <b>true</b> if the animation is done, <b>false</b> otherwise |
183 | */ | 177 | */ |
184 | |||
185 | public boolean isDone() { | 178 | public boolean isDone() { |
186 | return mDone; | 179 | return mDone; |
187 | } | 180 | } |
@@ -192,7 +185,6 @@ public final class Animation { | |||
192 | * number of frames will still be painted to prevent the screen from | 185 | * number of frames will still be painted to prevent the screen from |
193 | * flashing. | 186 | * flashing. |
194 | */ | 187 | */ |
195 | |||
196 | public void reset(List<Animal> animals) { | 188 | public void reset(List<Animal> animals) { |
197 | mGraphMap.clear(); | 189 | mGraphMap.clear(); |
198 | if (animals != null) { | 190 | if (animals != null) { |
@@ -225,7 +217,6 @@ public final class Animation { | |||
225 | * @param animal Animal whose image needs to be loaded or returned | 217 | * @param animal Animal whose image needs to be loaded or returned |
226 | * @return The buffered image of the animal | 218 | * @return The buffered image of the animal |
227 | */ | 219 | */ |
228 | |||
229 | private BufferedImage loadImage(Animal animal) { | 220 | private BufferedImage loadImage(Animal animal) { |
230 | // path = "img/superclass/class.png" | 221 | // path = "img/superclass/class.png" |
231 | String superClassName = animal.getClass().getSuperclass().getSimpleName(); | 222 | String superClassName = animal.getClass().getSuperclass().getSimpleName(); |