summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-09 12:01:43 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-09 12:01:43 +0100
commitcd27d013c29633f05d3db963b09c37c9397b684a (patch)
treeb7aaebea52a3b7a6468811ff44e9589aaa17dc78 /core/src/ch/asynk
parent458fbc78b2a678a01d148eb29d78a5cf80eb4d90 (diff)
downloadRustAndDust-cd27d013c29633f05d3db963b09c37c9397b684a.zip
RustAndDust-cd27d013c29633f05d3db963b09c37c9397b684a.tar.gz
Board: use ArrayListIt: for animations too
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Board.java17
1 files changed, 7 insertions, 10 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Board.java b/core/src/ch/asynk/rustanddust/engine/Board.java
index 2e5a0b1..21ad9b7 100644
--- a/core/src/ch/asynk/rustanddust/engine/Board.java
+++ b/core/src/ch/asynk/rustanddust/engine/Board.java
@@ -2,7 +2,6 @@ package ch.asynk.rustanddust.engine;
import java.util.Iterator;
import java.util.Collection;
-import java.util.ArrayList;
import java.util.LinkedHashSet;
import com.badlogic.gdx.Gdx;
@@ -61,7 +60,7 @@ public abstract class Board implements Disposable, Animation
private int tileCount = 0;
private int pawnCount = 0;
private int animationCount = 0;
- private final ArrayList<Animation> animations = new ArrayList<Animation>(2);
+ private final ArrayListIt<Animation> animations = new ArrayListIt<Animation>(2);
private final ArrayListIt<Animation> nextAnimations = new ArrayListIt<Animation>(10);
private final LinkedHashSet<Tile> tilesToDraw = new LinkedHashSet<Tile>();
@@ -132,8 +131,8 @@ public abstract class Board implements Disposable, Animation
for (Animation a : nextAnimations)
a.dispose();
animations.clear();
- for (int i = 0, n = animations.size(); i < n; i++)
- animations.get(i).dispose();
+ for (Animation a : animations)
+ a.dispose();
animations.clear();
if (selectedTile != null)
selectedTile.dispose();
@@ -286,9 +285,8 @@ public abstract class Board implements Disposable, Animation
while (tileIter.hasNext())
tileIter.next().draw(batch);
- Iterator<Animation> animationIter = animations.iterator();
- while (animationIter.hasNext())
- animationIter.next().draw(batch);
+ for (Animation a : animations)
+ a.draw(batch);
selectedTile.draw(batch);
@@ -308,9 +306,8 @@ public abstract class Board implements Disposable, Animation
while (iter.hasNext())
iter.next().drawDebug(debugShapes);
- Iterator<Animation> animationIter = animations.iterator();
- while (animationIter.hasNext())
- animationIter.next().drawDebug(debugShapes);
+ for (Animation a : animations)
+ a.drawDebug(debugShapes);
if (transform)
debugShapes.setTransformMatrix(prevTransform);