diff options
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 5 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Player.java | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index c10d3e7..b9fa335 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -172,6 +172,11 @@ public abstract class Pawn implements Moveable, Disposable move(); } + public boolean is(Faction faction) + { + return (this.faction == faction); + } + public boolean isEnemy(Faction other) { return faction.isEnemy(other); diff --git a/core/src/ch/asynk/tankontank/engine/Player.java b/core/src/ch/asynk/tankontank/engine/Player.java index 180df43..58839bf 100644 --- a/core/src/ch/asynk/tankontank/engine/Player.java +++ b/core/src/ch/asynk/tankontank/engine/Player.java @@ -45,6 +45,11 @@ public abstract class Player return faction.toString(); } + public boolean is(Faction faction) + { + return (this.faction == faction); + } + public boolean isEnemy(Pawn pawn) { return pawn.isEnemy(faction); |