diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-18 15:55:36 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-18 15:55:36 +0100 |
commit | 7c70b2a13d74a5021073fc963bc6252bfc2986ec (patch) | |
tree | f3dba3d44d57b8f5105dd56fad2bdccbad780bc0 /core/src/ch | |
parent | b1f683105f1c6118c6a7949435ca653d873aca01 (diff) | |
download | RustAndDust-7c70b2a13d74a5021073fc963bc6252bfc2986ec.zip RustAndDust-7c70b2a13d74a5021073fc963bc6252bfc2986ec.tar.gz |
Hud: dialogs is a Stack
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Hud.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Hud.java b/core/src/ch/asynk/rustanddust/game/Hud.java index 7a1e2ad..c2e3643 100644 --- a/core/src/ch/asynk/rustanddust/game/Hud.java +++ b/core/src/ch/asynk/rustanddust/game/Hud.java @@ -1,6 +1,6 @@ package ch.asynk.rustanddust.game; -import java.util.LinkedList; +import java.util.Stack; import com.badlogic.gdx.Gdx; @@ -44,7 +44,7 @@ public class Hud implements Disposable, Animation private StatisticsPanel stats; private EngagementPanel engagement; private OkCancel okCancel; - private LinkedList<Widget> dialogs = new LinkedList<Widget>(); + private Stack<Widget> dialogs = new Stack<Widget>(); public enum OkCancelAction { @@ -181,7 +181,7 @@ public class Hud implements Disposable, Animation hit = null; if (dialogs.size() > 0) { - Widget dialog = dialogs.getFirst(); + Widget dialog = dialogs.peek(); if (dialog.hit(x, y)) { hit = dialog; return true; @@ -210,7 +210,7 @@ public class Hud implements Disposable, Animation return false; if (dialogs.size() > 0) { - Widget dialog = dialogs.getFirst(); + Widget dialog = dialogs.peek(); if (hit == dialog) { if (dialog.hit(x, y)) closeDialog(); @@ -237,7 +237,7 @@ public class Hud implements Disposable, Animation private void closeDialog() { - Widget dialog = dialogs.removeFirst(); + Widget dialog = dialogs.pop(); dialog.visible = false; if (dialog == okCancel) @@ -246,7 +246,7 @@ public class Hud implements Disposable, Animation ctrl.endGame(); if (dialogs.size() > 0) - dialogs.getFirst().visible = true; + dialogs.peek().visible = true; else ctrl.blockMap = false; } @@ -283,7 +283,7 @@ public class Hud implements Disposable, Animation private void delayOver() { delayOn = false; - Widget dialog = dialogs.getFirst(); + Widget dialog = dialogs.peek(); if (dialog == engagement) closeDialog(); } @@ -297,8 +297,8 @@ public class Hud implements Disposable, Animation { ctrl.blockMap = true; if (dialogs.size() != 0) - dialog.visible = false; - dialogs.addLast(dialog); + dialogs.peek().visible = false; + dialogs.push(dialog); } public void notifyDeploymentDone() |