diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-02-18 11:19:08 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-02-18 11:19:08 +0100 |
commit | db5d4de939a6f4ce0581ed61c4e7a9c9f04648df (patch) | |
tree | 255c755fbcf4f9757277594e209799c2226888fe /core/src/ch/asynk | |
parent | e60457b93f04a68d041898676966612861ac41a6 (diff) | |
download | RustAndDust-db5d4de939a6f4ce0581ed61c4e7a9c9f04648df.zip RustAndDust-db5d4de939a6f4ce0581ed61c4e7a9c9f04648df.tar.gz |
Map: code reorder
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 61e98c8..695f256 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -450,6 +450,23 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS ctrl.animationDone(); } + private void addEngagementAnimation(Unit target) + { + FireAnimation.reset(); + Hex to = target.getHex(); + for (Unit u : activatedUnits) { + Hex from = u.getHex(); + AnimationSequence seq = AnimationSequence.get(2); + float halfWidth = (u.getWidth() / 2f); + if (u.isA(Unit.UnitType.INFANTRY)) + seq.addAnimation(InfantryFireAnimation.get(ctrl.cfg.fxVolume, from.getX(), from.getY(), to.getX(), to.getY(), halfWidth)); + else + seq.addAnimation(TankFireAnimation.get(ctrl.cfg.fxVolume, from.getX(), from.getY(), to.getX(), to.getY(), halfWidth)); + seq.addAnimation(notifyDoneAnimation(target)); + addAnimation(seq); + } + } + private boolean resolveFight(Unit unit, final Unit target, boolean mayReroll) { int d1 = d6(); @@ -523,23 +540,6 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS return success; } - private void addEngagementAnimation(Unit target) - { - FireAnimation.reset(); - Hex to = target.getHex(); - for (Unit u : activatedUnits) { - Hex from = u.getHex(); - AnimationSequence seq = AnimationSequence.get(2); - float halfWidth = (u.getWidth() / 2f); - if (u.isA(Unit.UnitType.INFANTRY)) - seq.addAnimation(InfantryFireAnimation.get(ctrl.cfg.fxVolume, from.getX(), from.getY(), to.getX(), to.getY(), halfWidth)); - else - seq.addAnimation(TankFireAnimation.get(ctrl.cfg.fxVolume, from.getX(), from.getY(), to.getX(), to.getY(), halfWidth)); - seq.addAnimation(notifyDoneAnimation(target)); - addAnimation(seq); - } - } - public boolean engageUnit(Unit unit, final Unit target) { boolean mayReroll = false; |