summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java5
-rw-r--r--core/src/ch/asynk/tankontank/engine/Player.java5
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);