diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-13 17:13:57 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-13 17:13:57 +0200 |
commit | a0b2ae4c0e05a4d13169d0ea6d688ace34e4c155 (patch) | |
tree | 452c9c27c223017023c66fe84b93f2d87f0d97a6 /core/src/ch/asynk | |
parent | 93f26e987f40b32749c716f447259f446c0b4816 (diff) | |
download | RustAndDust-a0b2ae4c0e05a4d13169d0ea6d688ace34e4c155.zip RustAndDust-a0b2ae4c0e05a4d13169d0ea6d688ace34e4c155.tar.gz |
Player: add casualty(Pawn)
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Player.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Player.java b/core/src/ch/asynk/tankontank/game/Player.java index adc2f05..e6bef72 100644 --- a/core/src/ch/asynk/tankontank/game/Player.java +++ b/core/src/ch/asynk/tankontank/game/Player.java @@ -23,7 +23,7 @@ public class Player implements Drawable, Disposable private Army army; private Image flag; private ArrayList<Pawn> units; - private ArrayList<Pawn> losses; + private ArrayList<Pawn> casualties; private ArrayList<Pawn> reinforcement; private int actionPoints; @@ -32,7 +32,7 @@ public class Player implements Drawable, Disposable this.army = army; this.flag = new Image(atlas.findRegion(name)); this.units = new ArrayList<Pawn>(size); - this.losses = new ArrayList<Pawn>(size); + this.casualties = new ArrayList<Pawn>(size); this.reinforcement = new ArrayList<Pawn>(size); this.actionPoints = 0; } @@ -40,7 +40,7 @@ public class Player implements Drawable, Disposable public String toString() { return army + " AP: " + actionPoints + - " units:" + units.size() + " losses:" + losses.size() + " reinforcement:" + reinforcement.size(); + " units:" + units.size() + " casualties:" + casualties.size() + " reinforcement:" + reinforcement.size(); } @Override @@ -54,6 +54,13 @@ public class Player implements Drawable, Disposable units.add(pawn); } + public void casualty(Pawn pawn) + { + units.remove(pawn); + casualties.add(pawn); + System.err.println(" casualty : " + pawn); + } + public Image getFlag() { return flag; |