From 3efa7de9963a40e7aac77abddef554bda3cda336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 28 Oct 2014 16:09:11 +0100 Subject: Player: Pawn promote(Pawn pawn) -> Unit promote(Unit unit) --- core/src/ch/asynk/tankontank/game/Player.java | 10 +++++----- 1 file 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; -- cgit v1.1-2-g2b99