diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-03 11:43:06 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-03 11:43:06 +0200 |
commit | 93228ad6e320029b2e2eaba468e7e77604a6bcdb (patch) | |
tree | d050f38bcf44a2258493faa41b6350fbe0328f98 /core/src/ch | |
parent | a52a736fcc0025847ffe6647db7c64f4e31b4799 (diff) | |
download | RustAndDust-93228ad6e320029b2e2eaba468e7e77604a6bcdb.zip RustAndDust-93228ad6e320029b2e2eaba468e7e77604a6bcdb.tar.gz |
Pawn: rename path -> moves
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 9c7b4d2..582fbfd 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -1,5 +1,6 @@ package ch.asynk.tankontank.engine; +import java.util.Vector; import java.util.ArrayDeque; import com.badlogic.gdx.utils.Disposable; @@ -22,7 +23,7 @@ public abstract class Pawn extends Image implements Disposable private static final float MOVE_TIME = 0.3f; private StackedImages overlays; - private ArrayDeque<Vector3> path = new ArrayDeque<Vector3>(); + private ArrayDeque<Vector3> moves = new ArrayDeque<Vector3>(); public abstract int getMovementPoints(); public abstract int getRoadMarchBonus(); @@ -44,8 +45,8 @@ public abstract class Pawn extends Image implements Disposable public Vector3 getLastPosition() { - if ((path == null) || (path.size() == 0)) return null; - return path.getFirst(); + if ((moves == null) || (moves.size() == 0)) return null; + return moves.getFirst(); } public Orientation getOrientation() @@ -55,9 +56,9 @@ public abstract class Pawn extends Image implements Disposable public void moveDone() { - Vector3 v = path.pop(); - path.clear(); - path.push(v); + Vector3 v = moves.pop(); + moves.clear(); + moves.push(v); } public void pushMove(float x, float y, Orientation o) @@ -65,24 +66,24 @@ public abstract class Pawn extends Image implements Disposable float r = ((o == Orientation.KEEP) ? getRotation() : o.r()); setPosition(x, y, r); Vector3 v = new Vector3(x, y, r); - if ((path.size() == 0) || (!v.equals(path.getFirst()))) - path.push(new Vector3(x, y, r)); + if ((moves.size() == 0) || (!v.equals(moves.getFirst()))) + moves.push(new Vector3(x, y, r)); } public AnimationSequence getResetMovesAnimation() { - final Vector3 finalPos = path.getLast(); + final Vector3 finalPos = moves.getLast(); - AnimationSequence seq = AnimationSequence.get(path.size() + 1); + AnimationSequence seq = AnimationSequence.get(moves.size() + 1); - while(path.size() != 0) { - seq.addAnimation(MoveToAnimation.get(this, path.pop(), MOVE_TIME)); + while(moves.size() != 0) { + seq.addAnimation(MoveToAnimation.get(this, moves.pop(), MOVE_TIME)); } seq.addAnimation(RunnableAnimation.get(this, new Runnable() { @Override public void run() { - path.push(finalPos); + moves.push(finalPos); } })); |