diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-29 00:59:33 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-29 00:59:33 +0100 |
commit | 6487955b187a469186a8348eeaac070d1543f2a7 (patch) | |
tree | 9fb6e1f1b31ee48c6f30e6740dc8d11cc626b293 /core/src/ch/asynk/tankontank/engine | |
parent | c9d131e5fb4d4cb5b1147d53e7dbe5baa9767eee (diff) | |
download | RustAndDust-6487955b187a469186a8348eeaac070d1543f2a7.zip RustAndDust-6487955b187a469186a8348eeaac070d1543f2a7.tar.gz |
Map: possibleTargets and attackAssists are Board.PawnCollection, activablePawns is no more
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index 88a63ec..402a8e0 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -267,14 +267,14 @@ public abstract class Board implements Disposable return moves.fromNodes(nodes); } - protected int buildPossibleTargets(Pawn pawn, TileCollection targets) + protected int collectPossibleTargets(Pawn pawn, PawnCollection targets) { Tile from = pawn.getTile(); List<SearchBoard.Node> nodes = searchBoard.possibleTargetsFrom(pawn, from.getCol(), from.getRow()); return targets.fromNodes(nodes); } - protected int buildPossibleTargets(Pawn pawn, Iterator<Pawn> units, TileCollection targets) + protected int collectPossibleTargets(Pawn pawn, Iterator<Pawn> units, PawnCollection targets) { Tile from = pawn.getTile(); targets.clear(); @@ -282,7 +282,7 @@ public abstract class Board implements Disposable Pawn target = units.next(); Tile to = target.getTile(); if (searchBoard.buildAttack(pawn, true, target, from.getCol(), from.getRow(), to.getCol(), to.getRow())) - targets.add(to); + targets.add(target); } return targets.size(); @@ -306,7 +306,7 @@ public abstract class Board implements Disposable return assists.size(); } - protected int buildAttackAssists(Pawn pawn, Pawn target, Iterator<Pawn> units, TileCollection assists) + protected int collectAttackAssists(Pawn pawn, Pawn target, Iterator<Pawn> units, PawnCollection assists) { assists.clear(); Tile to = target.getTile(); @@ -316,7 +316,7 @@ public abstract class Board implements Disposable Tile from = p.getTile(); if (searchBoard.buildAttack(p, !p.canAssistAttackWithoutLos(), target, from.getCol(), from.getRow(), to.getCol(), to.getRow())) { if (p != pawn) - assists.add(from); + assists.add(p); } } |