diff options
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Command.java | 7 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Engagement.java | 4 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java | 8 |
3 files changed, 9 insertions, 10 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Command.java b/core/src/ch/asynk/rustanddust/game/Command.java index 330e44a..dbd0c21 100644 --- a/core/src/ch/asynk/rustanddust/game/Command.java +++ b/core/src/ch/asynk/rustanddust/game/Command.java @@ -1,7 +1,5 @@ package ch.asynk.rustanddust.game; -import java.util.List; - import com.badlogic.gdx.utils.Pool; import com.badlogic.gdx.utils.Json; import com.badlogic.gdx.utils.JsonValue; @@ -10,6 +8,7 @@ import ch.asynk.rustanddust.engine.Order; import ch.asynk.rustanddust.engine.Move; import ch.asynk.rustanddust.engine.Pawn; import ch.asynk.rustanddust.engine.Tile; +import ch.asynk.rustanddust.engine.util.Collection; public class Command extends Order { @@ -191,7 +190,7 @@ public class Command extends Order json.writeObjectEnd(); } - private void writeUnits(Json json, String key, List<Unit> units) + private void writeUnits(Json json, String key, Collection<Unit> units) { json.writeArrayStart(key); for (Unit u : units) @@ -209,7 +208,7 @@ public class Command extends Order json.writeObjectEnd(); } - private void writeTiles(Json json, String key, List<Tile> tiles) + private void writeTiles(Json json, String key, Collection<Tile> tiles) { json.writeArrayStart(key); for (Tile t : tiles) diff --git a/core/src/ch/asynk/rustanddust/game/Engagement.java b/core/src/ch/asynk/rustanddust/game/Engagement.java index 937739e..2d3bd24 100644 --- a/core/src/ch/asynk/rustanddust/game/Engagement.java +++ b/core/src/ch/asynk/rustanddust/game/Engagement.java @@ -1,11 +1,11 @@ package ch.asynk.rustanddust.game; -import java.util.List; import java.util.Random; import com.badlogic.gdx.utils.Pool; import com.badlogic.gdx.utils.Disposable; +import ch.asynk.rustanddust.engine.util.Collection; import ch.asynk.rustanddust.engine.util.IterableArray; public class Engagement implements Disposable, Pool.Poolable @@ -36,7 +36,7 @@ public class Engagement implements Disposable, Pool.Poolable public Unit attacker; public Unit defender; - public List<Unit> assists; + public Collection<Unit> assists; public boolean success; public int d1; public int d2; diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java index 5023d5a..e09ce8d 100644 --- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java +++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java @@ -28,8 +28,8 @@ public abstract class BattleCommon implements Battle protected Player currentPlayer; protected Player usPlayer; protected Player gePlayer; - protected IterableArray<Zone> entryZone = new IterableArray<Zone>(); - protected IterableArray<Zone> exitZone = new IterableArray<Zone>(); + protected IterableArray<Zone> entryZones = new IterableArray<Zone>(10); + protected IterableArray<Zone> exitZones = new IterableArray<Zone>(10); protected HashMap<Unit, Zone> unitEntry = new HashMap<Unit, Zone>(); protected HashMap<Unit, Zone> unitExit = new HashMap<Unit, Zone>(); @@ -172,12 +172,12 @@ public abstract class BattleCommon implements Battle protected void addEntryZone(Zone entry) { - entryZone.add(entry); + entryZones.add(entry); } protected void addExitZone(Zone exit) { - exitZone.add(exit); + exitZones.add(exit); exit.enable(Hex.EXIT, true); } |