From 18727a3409698351b13b000f9adbc0e6fc840b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 13 Nov 2014 00:21:01 +0100 Subject: engine/Player Pawn: add is(Faction) --- core/src/ch/asynk/tankontank/engine/Pawn.java | 5 +++++ core/src/ch/asynk/tankontank/engine/Player.java | 5 +++++ 2 files changed, 10 insertions(+) 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); -- cgit v1.1-2-g2b99