From 9347eb15e8bc49efabd0dfc53d1a1995cd4a6d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 15 Dec 2015 17:02:16 +0100 Subject: Player,StatisticsPanel: add Objectives count --- core/src/ch/asynk/rustanddust/game/Player.java | 12 +++++++----- core/src/ch/asynk/rustanddust/game/hud/StatisticsPanel.java | 2 +- core/src/ch/asynk/rustanddust/game/states/StateEngage.java | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/Player.java b/core/src/ch/asynk/rustanddust/game/Player.java index fb26680..6495e8e 100644 --- a/core/src/ch/asynk/rustanddust/game/Player.java +++ b/core/src/ch/asynk/rustanddust/game/Player.java @@ -20,8 +20,9 @@ public class Player public UnitList withdrawed; public int actionCount; - public int lostEngagementCount; - public int wonEngagementCount; + public int objectivesWon; + public int engagementWon; + public int engagementLost; public Player(final RustAndDust game, Army army, int n) { @@ -35,8 +36,9 @@ public class Player this.actionPoints = 0; this.deploymentDone = false; this.actionCount = 0; - this.lostEngagementCount = 0; - this.wonEngagementCount = 0; + this.objectivesWon = 0; + this.engagementWon = 0; + this.engagementLost = 0; } public String getName() @@ -51,7 +53,7 @@ public class Player public String getStats() { - return String.format("%s\n%4d\n%4d\n%4d\n%4d\n%4d\n%4d", getName(), actionCount, unitsLeft(), withdrawed(), casualties(), wonEngagementCount, lostEngagementCount); + return String.format("%s\n%4d\n%4d\n%4d\n%4d\n%4d", getName(), actionCount, unitsLeft(), withdrawed(), casualties(), objectivesWon); } public boolean is(Army army) diff --git a/core/src/ch/asynk/rustanddust/game/hud/StatisticsPanel.java b/core/src/ch/asynk/rustanddust/game/hud/StatisticsPanel.java index 4e7250b..c1ede26 100644 --- a/core/src/ch/asynk/rustanddust/game/hud/StatisticsPanel.java +++ b/core/src/ch/asynk/rustanddust/game/hud/StatisticsPanel.java @@ -38,7 +38,7 @@ public class StatisticsPanel extends Patch this.geFlag = new Bg(hudAtlas.findRegion("ge-flag")); this.usFlag = new Bg(hudAtlas.findRegion("us-flag")); this.visible = false; - this.header.write("\nActions\nUnits Left\nUnits Withrawed\nCasualties\nWon Attacks\nLost Attacks"); + this.header.write("\nActions\nUnits Left\nUnits Withrawed\nCasualties\nObjectives"); } public void updatePosition() diff --git a/core/src/ch/asynk/rustanddust/game/states/StateEngage.java b/core/src/ch/asynk/rustanddust/game/states/StateEngage.java index 0d342ad..2345aa0 100644 --- a/core/src/ch/asynk/rustanddust/game/states/StateEngage.java +++ b/core/src/ch/asynk/rustanddust/game/states/StateEngage.java @@ -53,13 +53,13 @@ public class StateEngage extends StateCommon { StateType nextState = StateType.DONE; if (map.engageUnit(selectedUnit, activeUnit)) { - ctrl.battle.getPlayer().wonEngagementCount += 1; + ctrl.battle.getPlayer().engagementWon += 1; ctrl.battle.getOpponent().casualty(activeUnit); if (map.unitsBreakThroughSize() > 0) { nextState = StateType.BREAK; } } else { - ctrl.battle.getPlayer().lostEngagementCount += 1; + ctrl.battle.getPlayer().engagementLost += 1; } activeUnit.showTarget(); -- cgit v1.1-2-g2b99