summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-13 00:21:01 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-13 00:21:01 +0100
commit18727a3409698351b13b000f9adbc0e6fc840b64 (patch)
tree1563dc2e7e66ab11d82e8d0772b08e523dc02e26 /core/src
parent447ece22efb5c26ed1b238df806457adc502b865 (diff)
downloadRustAndDust-18727a3409698351b13b000f9adbc0e6fc840b64.zip
RustAndDust-18727a3409698351b13b000f9adbc0e6fc840b64.tar.gz
engine/Player Pawn: add is(Faction)
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);