From a7662a4a96ae321a2c741bac6534f1356729c5be Mon Sep 17 00:00:00 2001 From: Jérémy Zurcher Date: Sun, 21 Sep 2014 02:53:08 +0200 Subject: RunnableAnimation needs a ref to Pawn too --- .../asynk/tankontank/engine/gfx/animations/RunnableAnimation.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/src/ch/asynk/tankontank/engine/gfx') diff --git a/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java b/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java index 41a08a73..24b1e4ba 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/animations/RunnableAnimation.java @@ -8,6 +8,7 @@ import ch.asynk.tankontank.engine.gfx.Animation; public class RunnableAnimation implements Animation, Pool.Poolable { private Runnable runnable; + private Pawn pawn; private boolean ran; private static final Pool runnableAnimationPool = new Pool() { @@ -17,10 +18,11 @@ public class RunnableAnimation implements Animation, Pool.Poolable } }; - public static RunnableAnimation get(Runnable runnable) + public static RunnableAnimation get(Pawn pawn, Runnable runnable) { RunnableAnimation a = runnableAnimationPool.obtain(); a.runnable = runnable; + a.pawn = pawn; return a; } @@ -39,7 +41,7 @@ public class RunnableAnimation implements Animation, Pool.Poolable @Override public Pawn getPawn() { - return null; + return pawn; } @Override -- cgit v1.2.3