diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-30 13:39:48 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-30 13:39:48 +0100 |
commit | 16e2a507c80f296a17e1fcefb6f29bcbdc81222d (patch) | |
tree | add47f3dd40cd64635008e0ecf5bfa4567a98c69 /core | |
parent | f50eb8f8d020ff331fa057c71d244a758a0b0425 (diff) | |
download | RustAndDust-16e2a507c80f296a17e1fcefb6f29bcbdc81222d.zip RustAndDust-16e2a507c80f296a17e1fcefb6f29bcbdc81222d.tar.gz |
Pawn: remove boolean canBeAttacked(Pawn) -> use boolean canAttack(Pawn)
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Unit.java | 6 |
3 files changed, 1 insertions, 8 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index 1eb68dd..42b8f23 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -275,7 +275,7 @@ public abstract class Board implements Disposable targets.clear(); while (units.hasNext()) { Pawn target = units.next(); - if (!target.canBeAttacked(pawn)) continue; + if (!pawn.canAttack(target)) continue; Tile to = target.getTile(); if (searchBoard.collectAttack(pawn, true, target, from.getCol(), from.getRow(), to.getCol(), to.getRow())) targets.add(target); diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 42a4083..db54f36 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -62,7 +62,6 @@ public abstract class Pawn implements Moveable, Disposable public abstract boolean canRotate(); public abstract boolean canAttack(); public abstract boolean canAttack(Pawn other); - public abstract boolean canBeAttacked(Pawn other); public abstract boolean canAssistAttackWithoutLos(); public abstract void move(int cost); diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index 5670c1b..71182a2 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -195,12 +195,6 @@ public class Unit extends HeadedPawn } @Override - public boolean canBeAttacked(Pawn other) - { - return true; - } - - @Override public void rotate(Orientation o) { hasMoved = true; |