summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-11 10:37:38 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-11 11:45:57 +0100
commit432fb6f91d186dd7dad12982d24aa66a4ae80ec0 (patch)
tree015163fd9b71898d0f659f4ed7f385f7c25841e5 /core/src/ch/asynk
parent21af522854d1b10289e6c338be0663132afe5ba6 (diff)
downloadRustAndDust-432fb6f91d186dd7dad12982d24aa66a4ae80ec0.zip
RustAndDust-432fb6f91d186dd7dad12982d24aa66a4ae80ec0.tar.gz
ArrayListIt -> IterableArray
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Board.java8
-rw-r--r--core/src/ch/asynk/rustanddust/engine/OrderList.java4
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Path.java6
-rw-r--r--core/src/ch/asynk/rustanddust/engine/PathBuilder.java14
-rw-r--r--core/src/ch/asynk/rustanddust/engine/SearchBoard.java18
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Tile.java6
-rw-r--r--core/src/ch/asynk/rustanddust/engine/TileSet.java4
-rw-r--r--core/src/ch/asynk/rustanddust/engine/gfx/animations/AnimationSequence.java6
-rw-r--r--core/src/ch/asynk/rustanddust/engine/util/IterableArray.java (renamed from core/src/ch/asynk/rustanddust/engine/util/ArrayListIt.java)6
-rw-r--r--core/src/ch/asynk/rustanddust/game/Engagement.java4
-rw-r--r--core/src/ch/asynk/rustanddust/game/UnitList.java4
-rw-r--r--core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java6
12 files changed, 43 insertions, 43 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Board.java b/core/src/ch/asynk/rustanddust/engine/Board.java
index 3bf909e..119e850 100644
--- a/core/src/ch/asynk/rustanddust/engine/Board.java
+++ b/core/src/ch/asynk/rustanddust/engine/Board.java
@@ -14,7 +14,7 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Matrix4;
-import ch.asynk.rustanddust.engine.util.ArrayListIt;
+import ch.asynk.rustanddust.engine.util.IterableArray;
import ch.asynk.rustanddust.engine.gfx.Moveable;
import ch.asynk.rustanddust.engine.gfx.Animation;
import ch.asynk.rustanddust.engine.gfx.animations.AnimationSequence;
@@ -59,9 +59,9 @@ public abstract class Board implements Disposable, Animation
private int tileCount = 0;
private int pawnCount = 0;
private int animationCount = 0;
- private final ArrayListIt<Animation> animations = new ArrayListIt<Animation>(10);
- private final ArrayListIt<Animation> nextAnimations = new ArrayListIt<Animation>(10);
- private final ArrayListIt<Tile> tilesToDraw = new ArrayListIt<Tile>(20);
+ private final IterableArray<Animation> animations = new IterableArray<Animation>(10);
+ private final IterableArray<Animation> nextAnimations = new IterableArray<Animation>(10);
+ private final IterableArray<Tile> tilesToDraw = new IterableArray<Tile>(20);
protected SelectedTile selectedTile;
diff --git a/core/src/ch/asynk/rustanddust/engine/OrderList.java b/core/src/ch/asynk/rustanddust/engine/OrderList.java
index 92a85ea..9e4fe6c 100644
--- a/core/src/ch/asynk/rustanddust/engine/OrderList.java
+++ b/core/src/ch/asynk/rustanddust/engine/OrderList.java
@@ -6,9 +6,9 @@ import com.badlogic.gdx.utils.Json;
import com.badlogic.gdx.utils.JsonValue;
import com.badlogic.gdx.utils.JsonWriter.OutputType;
-import ch.asynk.rustanddust.engine.util.ArrayListIt;
+import ch.asynk.rustanddust.engine.util.IterableArray;
-public class OrderList extends ArrayListIt<Order> implements Json.Serializable
+public class OrderList extends IterableArray<Order> implements Json.Serializable
{
public OrderList(int capacity)
{
diff --git a/core/src/ch/asynk/rustanddust/engine/Path.java b/core/src/ch/asynk/rustanddust/engine/Path.java
index 6fd3c47..bb772b3 100644
--- a/core/src/ch/asynk/rustanddust/engine/Path.java
+++ b/core/src/ch/asynk/rustanddust/engine/Path.java
@@ -3,7 +3,7 @@ package ch.asynk.rustanddust.engine;
import com.badlogic.gdx.utils.Pool;
import com.badlogic.gdx.utils.Disposable;
-import ch.asynk.rustanddust.engine.util.ArrayListIt;
+import ch.asynk.rustanddust.engine.util.IterableArray;
public class Path implements Disposable, Pool.Poolable
{
@@ -29,7 +29,7 @@ public class Path implements Disposable, Pool.Poolable
public int cost;
public int fitness;
public boolean roadMarch;
- public ArrayListIt<Tile> tiles;
+ public IterableArray<Tile> tiles;
public Path()
{
@@ -42,7 +42,7 @@ public class Path implements Disposable, Pool.Poolable
protected void init(int size)
{
if (tiles == null)
- tiles = new ArrayListIt<Tile>(size);
+ tiles = new IterableArray<Tile>(size);
else
tiles. ensureCapacity(size);
cost = -1;
diff --git a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
index aaaf399..d5c79d9 100644
--- a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
+++ b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
@@ -4,7 +4,7 @@ import java.util.List;
import com.badlogic.gdx.utils.Disposable;
-import ch.asynk.rustanddust.engine.util.ArrayListIt;
+import ch.asynk.rustanddust.engine.util.IterableArray;
public class PathBuilder implements Disposable
{
@@ -19,16 +19,16 @@ public class PathBuilder implements Disposable
private List<Tile> ctrlTiles;
private List<Path> paths;
private List<Path> filteredPaths;
- private ArrayListIt<Tile> tiles;
+ private IterableArray<Tile> tiles;
public PathBuilder(Board board, int tSize, int stSize, int ftSize, int psSize)
{
this.board = board;
- this.tiles = new ArrayListIt<Tile>(tSize);
- this.stack = new ArrayListIt<Tile>(stSize);
- this.ctrlTiles = new ArrayListIt<Tile>(ftSize);
- this.paths = new ArrayListIt<Path>(psSize);
- this.filteredPaths = new ArrayListIt<Path>(psSize);
+ this.tiles = new IterableArray<Tile>(tSize);
+ this.stack = new IterableArray<Tile>(stSize);
+ this.ctrlTiles = new IterableArray<Tile>(ftSize);
+ this.paths = new IterableArray<Path>(psSize);
+ this.filteredPaths = new IterableArray<Path>(psSize);
this.to = null;
this.pawn = null;
this.orientation = Orientation.KEEP;
diff --git a/core/src/ch/asynk/rustanddust/engine/SearchBoard.java b/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
index 9fd06ad..7fd2ef6 100644
--- a/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
+++ b/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
@@ -3,7 +3,7 @@ package ch.asynk.rustanddust.engine;
import java.util.List;
import java.util.Collection;
-import ch.asynk.rustanddust.engine.util.ArrayListIt;
+import ch.asynk.rustanddust.engine.util.IterableArray;
public class SearchBoard
{
@@ -35,10 +35,10 @@ public class SearchBoard
private int searchCount;
private Node nodes[];
- private ArrayListIt<Node> stack;
- private ArrayListIt<Node> queue;
- private ArrayListIt<Node> roadMarch;
- private ArrayListIt<Node> los;
+ private IterableArray<Node> stack;
+ private IterableArray<Node> queue;
+ private IterableArray<Node> roadMarch;
+ private IterableArray<Node> los;
private boolean losBlocked;
public SearchBoard(Board board, int cols, int rows)
@@ -55,10 +55,10 @@ public class SearchBoard
nodes[i + (j * cols)] = new Node((i + dx), j);
}
- this.queue = new ArrayListIt<Node>(30);
- this.stack = new ArrayListIt<Node>(20);
- this.roadMarch = new ArrayListIt<Node>(5);
- this.los = new ArrayListIt<Node>(10);
+ this.queue = new IterableArray<Node>(30);
+ this.stack = new IterableArray<Node>(20);
+ this.roadMarch = new IterableArray<Node>(5);
+ this.los = new IterableArray<Node>(10);
}
private boolean inMap(int col, int row)
diff --git a/core/src/ch/asynk/rustanddust/engine/Tile.java b/core/src/ch/asynk/rustanddust/engine/Tile.java
index 7bb2fe7..20d8fd7 100644
--- a/core/src/ch/asynk/rustanddust/engine/Tile.java
+++ b/core/src/ch/asynk/rustanddust/engine/Tile.java
@@ -8,7 +8,7 @@ import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
-import ch.asynk.rustanddust.engine.util.ArrayListIt;
+import ch.asynk.rustanddust.engine.util.IterableArray;
import ch.asynk.rustanddust.engine.gfx.Drawable;
import ch.asynk.rustanddust.engine.gfx.StackedImages;
@@ -31,7 +31,7 @@ public abstract class Tile implements Drawable, Disposable, Iterable<Pawn>
protected float x;
protected float y;
private StackedImages overlays;
- private ArrayListIt<Pawn> stack;
+ private IterableArray<Pawn> stack;
protected Faction curFaction;
protected Faction prevFaction;
@@ -51,7 +51,7 @@ public abstract class Tile implements Drawable, Disposable, Iterable<Pawn>
{
this.col = col;
this.row = row;
- this.stack = new ArrayListIt<Pawn>(capacity);
+ this.stack = new IterableArray<Pawn>(capacity);
this.curFaction = defaultFaction;
this.prevFaction = defaultFaction;
this.objective = Objective.NONE;
diff --git a/core/src/ch/asynk/rustanddust/engine/TileSet.java b/core/src/ch/asynk/rustanddust/engine/TileSet.java
index 9531549..233232e 100644
--- a/core/src/ch/asynk/rustanddust/engine/TileSet.java
+++ b/core/src/ch/asynk/rustanddust/engine/TileSet.java
@@ -1,8 +1,8 @@
package ch.asynk.rustanddust.engine;
-import ch.asynk.rustanddust.engine.util.ArrayListIt;
+import ch.asynk.rustanddust.engine.util.IterableArray;
-public class TileSet extends ArrayListIt<Tile>
+public class TileSet extends IterableArray<Tile>
{
private final Board board;
diff --git a/core/src/ch/asynk/rustanddust/engine/gfx/animations/AnimationSequence.java b/core/src/ch/asynk/rustanddust/engine/gfx/animations/AnimationSequence.java
index d2feee8..49dd353 100644
--- a/core/src/ch/asynk/rustanddust/engine/gfx/animations/AnimationSequence.java
+++ b/core/src/ch/asynk/rustanddust/engine/gfx/animations/AnimationSequence.java
@@ -5,11 +5,11 @@ import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import ch.asynk.rustanddust.engine.gfx.Animation;
-import ch.asynk.rustanddust.engine.util.ArrayListIt;
+import ch.asynk.rustanddust.engine.util.IterableArray;
public class AnimationSequence implements Animation, Pool.Poolable
{
- private ArrayListIt<Animation> animations;
+ private IterableArray<Animation> animations;
private static final Pool<AnimationSequence> animationSequencePool = new Pool<AnimationSequence>() {
@Override
@@ -22,7 +22,7 @@ public class AnimationSequence implements Animation, Pool.Poolable
{
AnimationSequence seq = animationSequencePool.obtain();
if (seq.animations == null)
- seq.animations = new ArrayListIt<Animation>(capacity);
+ seq.animations = new IterableArray<Animation>(capacity);
else
seq.animations.ensureCapacity(capacity);
diff --git a/core/src/ch/asynk/rustanddust/engine/util/ArrayListIt.java b/core/src/ch/asynk/rustanddust/engine/util/IterableArray.java
index 16990eb..a8701a2 100644
--- a/core/src/ch/asynk/rustanddust/engine/util/ArrayListIt.java
+++ b/core/src/ch/asynk/rustanddust/engine/util/IterableArray.java
@@ -3,17 +3,17 @@ package ch.asynk.rustanddust.engine.util;
import java.util.ArrayList;
import java.util.Iterator;
-public class ArrayListIt<E> extends ArrayList<E> implements Iterator, Iterable<E>
+public class IterableArray<E> extends ArrayList<E> implements Iterator, Iterable<E>
{
private int i;
private int s;
- public ArrayListIt()
+ public IterableArray()
{
super();
}
- public ArrayListIt(int n)
+ public IterableArray(int n)
{
super(n);
}
diff --git a/core/src/ch/asynk/rustanddust/game/Engagement.java b/core/src/ch/asynk/rustanddust/game/Engagement.java
index 858792e..937739e 100644
--- a/core/src/ch/asynk/rustanddust/game/Engagement.java
+++ b/core/src/ch/asynk/rustanddust/game/Engagement.java
@@ -6,7 +6,7 @@ import java.util.Random;
import com.badlogic.gdx.utils.Pool;
import com.badlogic.gdx.utils.Disposable;
-import ch.asynk.rustanddust.engine.util.ArrayListIt;
+import ch.asynk.rustanddust.engine.util.IterableArray;
public class Engagement implements Disposable, Pool.Poolable
{
@@ -52,7 +52,7 @@ public class Engagement implements Disposable, Pool.Poolable
public Engagement()
{
- assists = new ArrayListIt<Unit>(10);
+ assists = new IterableArray<Unit>(10);
reset();
}
diff --git a/core/src/ch/asynk/rustanddust/game/UnitList.java b/core/src/ch/asynk/rustanddust/game/UnitList.java
index 834dd98..fde9a5c 100644
--- a/core/src/ch/asynk/rustanddust/game/UnitList.java
+++ b/core/src/ch/asynk/rustanddust/game/UnitList.java
@@ -1,11 +1,11 @@
package ch.asynk.rustanddust.game;
import java.util.Collection;
-import ch.asynk.rustanddust.engine.util.ArrayListIt;
+import ch.asynk.rustanddust.engine.util.IterableArray;
import ch.asynk.rustanddust.engine.Pawn;
-public class UnitList extends ArrayListIt<Unit>
+public class UnitList extends IterableArray<Unit>
{
public UnitList(int n)
{
diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
index 7b7904d..5023d5a 100644
--- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
+++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
@@ -14,7 +14,7 @@ import ch.asynk.rustanddust.game.Unit.UnitId;
import ch.asynk.rustanddust.game.Factory;
import ch.asynk.rustanddust.game.State.StateType;
import ch.asynk.rustanddust.engine.Orientation;
-import ch.asynk.rustanddust.engine.util.ArrayListIt;
+import ch.asynk.rustanddust.engine.util.IterableArray;
public abstract class BattleCommon implements Battle
{
@@ -28,8 +28,8 @@ public abstract class BattleCommon implements Battle
protected Player currentPlayer;
protected Player usPlayer;
protected Player gePlayer;
- protected ArrayListIt<Zone> entryZone = new ArrayListIt<Zone>();
- protected ArrayListIt<Zone> exitZone = new ArrayListIt<Zone>();
+ protected IterableArray<Zone> entryZone = new IterableArray<Zone>();
+ protected IterableArray<Zone> exitZone = new IterableArray<Zone>();
protected HashMap<Unit, Zone> unitEntry = new HashMap<Unit, Zone>();
protected HashMap<Unit, Zone> unitExit = new HashMap<Unit, Zone>();