diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-05-03 15:31:32 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-05-03 15:31:32 +0200 |
commit | 79793cf2dd5cad2af5fa513a7213292d2ee53f86 (patch) | |
tree | 306e849be86d992a543e42c8e8ddec80d24795a6 /core/src/ch/asynk/rustanddust/engine/Pawn.java | |
parent | cff800a98e8aec4e454c5dc84fd4249b7127a1fd (diff) | |
download | RustAndDust-79793cf2dd5cad2af5fa513a7213292d2ee53f86.zip RustAndDust-79793cf2dd5cad2af5fa513a7213292d2ee53f86.tar.gz |
OMG: add event queue, messages, replay, bounce animation, complete states rewrite ...
Diffstat (limited to 'core/src/ch/asynk/rustanddust/engine/Pawn.java')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/Pawn.java | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Pawn.java b/core/src/ch/asynk/rustanddust/engine/Pawn.java index fc0323f..d7c8749 100644 --- a/core/src/ch/asynk/rustanddust/engine/Pawn.java +++ b/core/src/ch/asynk/rustanddust/engine/Pawn.java @@ -115,20 +115,14 @@ public abstract class Pawn implements Moveable, Disposable { switch(move.type) { - case REGULAR: - if ((this.move != null) && (!this.move.isEnter())) - throw new RuntimeException("try to override an existing move instance"); + case SET: break; + case REGULAR: case ENTER: - if (this.move != null) - throw new RuntimeException("try to override an existing move instance"); - break; case EXIT: if (this.move != null) throw new RuntimeException("try to override an existing move instance"); break; - case SET: - break; default: throw new RuntimeException("unsupported MoveType"); } @@ -144,11 +138,6 @@ public abstract class Pawn implements Moveable, Disposable attack.distance = distance; } - public boolean justEntered() - { - return ((move != null) && move.isEnter()); - } - public boolean is(Faction faction) { return (this.faction == faction); @@ -333,28 +322,17 @@ public abstract class Pawn implements Moveable, Disposable return hasOverlayEnabled(); } - public AnimationSequence getRotateAnimation(float z, int size) - { - prevPosition.set(position); - AnimationSequence seq = AnimationSequence.get(1 + size); - seq.addAnimation(MoveToAnimation.get(this, position.x, position.y, z, MOVE_TIME)); - - return seq; - } - - public AnimationSequence getMoveAnimation(Iterator<Vector3> vectors, int size, MoveToAnimation.MoveToAnimationCb cb) + public AnimationSequence getMoveAnimation(Iterator<Vector3> vectors, AnimationSequence seq, MoveToAnimation.MoveToAnimationCb cb) { prevPosition.set(position); - AnimationSequence seq = AnimationSequence.get(size); while (vectors.hasNext()) seq.addAnimation(MoveToAnimation.get(this, vectors.next(), MOVE_TIME, cb)); return seq; } - public AnimationSequence getRevertLastMoveAnimation(int size) + public AnimationSequence getRevertLastMoveAnimation(AnimationSequence seq) { - AnimationSequence seq = AnimationSequence.get(2 + size); seq.addAnimation(MoveToAnimation.get(this, prevPosition, MOVE_TIME)); seq.addAnimation(RunnableAnimation.get(this, new Runnable() { @Override |