summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/Player.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Player.java b/core/src/ch/asynk/tankontank/game/Player.java
index 636fdd5..ffca1a2 100644
--- a/core/src/ch/asynk/tankontank/game/Player.java
+++ b/core/src/ch/asynk/tankontank/game/Player.java
@@ -22,6 +22,7 @@ public class Player
public ArrayList<Unit> units;
public ArrayList<Unit> casualties;
public ArrayList<Unit> reinforcement;
+ public ArrayList<Unit> escaped;
public int actionCount;
public int lostEngagementCount;
@@ -33,6 +34,7 @@ public class Player
this.units = new ArrayList<Unit>(n);
this.casualties = new ArrayList<Unit>(n);
this.reinforcement = new ArrayList<Unit>(n);
+ this.escaped = new ArrayList<Unit>(n);
this.turn = 0;
this.apSpent = 0;
this.actionPoints = 0;
@@ -94,6 +96,11 @@ public class Player
return casualties.size();
}
+ public int escaped()
+ {
+ return escaped.size();
+ }
+
public void addUnit(Unit unit)
{
units.add(unit);
@@ -122,6 +129,12 @@ public class Player
casualties.add(unit);
}
+ public void unitEscape(Unit unit)
+ {
+ units.remove(unit);
+ escaped.add(unit);
+ }
+
public int getAp()
{
return ((apSpent < actionPoints) ? (apSpent + 1) : apSpent);