diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-28 16:09:11 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-28 16:09:11 +0100 |
commit | 3efa7de9963a40e7aac77abddef554bda3cda336 (patch) | |
tree | 3fd9eed1656907ccde6b17648a20cd4ff9d62bbe /core/src | |
parent | ab6174f8efd85c7fd067465f0fded88807c3c155 (diff) | |
download | RustAndDust-3efa7de9963a40e7aac77abddef554bda3cda336.zip RustAndDust-3efa7de9963a40e7aac77abddef554bda3cda336.tar.gz |
Player: Pawn promote(Pawn pawn) -> Unit promote(Unit unit)
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Player.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Player.java b/core/src/ch/asynk/tankontank/game/Player.java index ee10dea..d10e6f7 100644 --- a/core/src/ch/asynk/tankontank/game/Player.java +++ b/core/src/ch/asynk/tankontank/game/Player.java @@ -104,15 +104,15 @@ public class Player extends ch.asynk.tankontank.engine.Player implements Drawabl return false; } - public Pawn promote(Pawn pawn) + public Unit promote(Unit unit) { for (Pawn p: casualties) { - if (p.isHqOf(pawn)) { - units.remove(pawn); - casualties.add(pawn); + if (p.isHqOf(unit)) { + units.remove(unit); + casualties.add(unit); units.add(p); casualties.remove(p); - return p; + return (Unit) p; } } return null; |