diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-14 11:17:59 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-14 11:17:59 +0200 |
commit | 03d764fc87370a7dc024b9065b019ed21107c95e (patch) | |
tree | ac1653ac844cbb10d11e4e89b5781c0faa1f0829 /core | |
parent | a34c377e53061db4d2affe8bda13d12fb1038911 (diff) | |
download | RustAndDust-03d764fc87370a7dc024b9065b019ed21107c95e.zip RustAndDust-03d764fc87370a7dc024b9065b019ed21107c95e.tar.gz |
Pawn,Unit add boolean canAssistAttackWithoutLos() and UnitType.ARTILLERY
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Factory.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Unit.java | 9 | ||||
-rw-r--r-- | core/test/ch/asynk/tankontank/Helpers.java | 1 |
4 files changed, 12 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index aa6e666..ef91544 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -53,6 +53,7 @@ public abstract class Pawn implements Drawable, Disposable public abstract boolean canRotate(); public abstract boolean canAttack(); public abstract boolean canAttack(Pawn other); + public abstract boolean canAssistAttackWithoutLos(); public abstract void move(int cost); public abstract void rotate(Orientation o); diff --git a/core/src/ch/asynk/tankontank/game/Factory.java b/core/src/ch/asynk/tankontank/game/Factory.java index 3f1e80a..ac4d671 100644 --- a/core/src/ch/asynk/tankontank/game/Factory.java +++ b/core/src/ch/asynk/tankontank/game/Factory.java @@ -73,6 +73,7 @@ public class Factory implements Board.TileBuilder, Disposable u = new Unit(Army.GE, ut, 3, 11, 1, pawnAtlas, "ge-tiger", "head"); break; case GE_WESPE: + ut = Unit.UnitType.ARTILLERY; u = new Unit(Army.GE, ut, 5, 8, 1, pawnAtlas, "ge-wespe", "head"); break; case US_AT_GUN: @@ -90,6 +91,7 @@ public class Factory implements Board.TileBuilder, Disposable u = new Unit(Army.US, utHq, 3, 10, 2, pawnAtlas, "us-pershing-hq", "head"); break; case US_PRIEST: + ut = Unit.UnitType.ARTILLERY; u = new Unit(Army.US, ut, 5, 8, 1, pawnAtlas, "us-priest", "head"); break; case US_SHERMAN: diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index b559489..6798aed 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -17,7 +17,8 @@ public class Unit extends HeadedPawn HARD_TARGET, HARD_TARGET_HQ, INFANTRY, - AT_GUN + AT_GUN, + ARTILLERY } public int rng; @@ -138,6 +139,12 @@ public class Unit extends HeadedPawn } @Override + public boolean canAssistAttackWithoutLos() + { + return (type == UnitType.ARTILLERY); + } + + @Override public boolean canAttack(Pawn other) { return isEnemy(other); diff --git a/core/test/ch/asynk/tankontank/Helpers.java b/core/test/ch/asynk/tankontank/Helpers.java index 0cd5eaa..518ccaf 100644 --- a/core/test/ch/asynk/tankontank/Helpers.java +++ b/core/test/ch/asynk/tankontank/Helpers.java @@ -36,6 +36,7 @@ public class Helpers public boolean canRotate() { return true; } public boolean canAttack() { return true; } public boolean canAttack(Pawn other) { return true; } + public boolean canAssistAttackWithoutLos() { return true; } public void move(int cost) { } public void rotate(Orientation o) { } |