diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index b8aead6..a097454 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -465,6 +465,12 @@ public abstract class Board implements Disposable, Animation pawn.revertLastMove(); } + public void attack(final Pawn pawn, final Pawn target, boolean clearVisibility) + { + if (!pawn.canEngage(target) || !searchBoard.canAttack(pawn, target, clearVisibility)) + throw new RuntimeException(String.format("%s cannot attack %s", pawn, target)); + } + public Tile getTileAt(float mx, float my) { // compute row |