summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/engine
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-04-05 09:23:50 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-04-05 09:23:50 +0200
commit24645c441330a33db1cc2d90d8f097a2adf0b868 (patch)
treeffcb86e67e073b2719ef7f488c60ec9db54a7b4a /core/src/ch/asynk/rustanddust/engine
parent16d5333e84dc0a2f981252d49f5cc87c82f513e2 (diff)
downloadRustAndDust-24645c441330a33db1cc2d90d8f097a2adf0b868.zip
RustAndDust-24645c441330a33db1cc2d90d8f097a2adf0b868.tar.gz
Map,Board: Map cleans Collection<Unit> before calling Board methods
Diffstat (limited to 'core/src/ch/asynk/rustanddust/engine')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Board.java3
-rw-r--r--core/src/ch/asynk/rustanddust/engine/SearchBoard.java2
2 files changed, 0 insertions, 5 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Board.java b/core/src/ch/asynk/rustanddust/engine/Board.java
index 5db34e3..6b80c04 100644
--- a/core/src/ch/asynk/rustanddust/engine/Board.java
+++ b/core/src/ch/asynk/rustanddust/engine/Board.java
@@ -325,7 +325,6 @@ public abstract class Board implements Disposable, Animation
protected int collectPossibleTargets(Pawn pawn, Collection<Pawn> units, Collection<Pawn> targets)
{
- targets.clear();
for (Pawn target : units) {
if (pawn.canEngage(target) && searchBoard.canAttack(pawn, target, true))
targets.add(target);
@@ -336,7 +335,6 @@ public abstract class Board implements Disposable, Animation
protected int collectMoveAssists(Pawn pawn, Collection<Pawn> assists)
{
- assists.clear();
setAdjacentTiles(pawn.getTile(), neighbours);
for (int i = 0; i < 6; i++) {
Tile tile = neighbours[i];
@@ -352,7 +350,6 @@ public abstract class Board implements Disposable, Animation
protected int collectAttackAssists(Pawn pawn, Pawn target, Collection<Pawn> units, Collection<Pawn> assists)
{
- assists.clear();
for (Pawn p : units) {
if ((p != pawn) && p.canEngage(target) && searchBoard.canAttack(p, target, !p.canAssistEngagementWithoutLos()))
assists.add(p);
diff --git a/core/src/ch/asynk/rustanddust/engine/SearchBoard.java b/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
index 141f5cc..803214e 100644
--- a/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
+++ b/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
@@ -110,7 +110,6 @@ public class SearchBoard
public int possibleMovesFrom(Pawn pawn, Collection<Tile> moves)
{
- moves.clear();
searchCount += 1;
Node adjacents[] = new Node[6];
@@ -264,7 +263,6 @@ public class SearchBoard
public int possibleTargetsFrom(Pawn shooter, Collection<Pawn> targets)
{
- targets.clear();
searchCount += 1;
Node adjacents[] = new Node[6];