From 457a018f06b2aa7ea84429e83a414b81ed848a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 18 Oct 2018 11:08:16 +0200 Subject: MoveAnimation : code simplification --- core/src/ch/asynk/gdx/boardgame/animations/MoveAnimation.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/src/ch/asynk/gdx/boardgame/animations/MoveAnimation.java b/core/src/ch/asynk/gdx/boardgame/animations/MoveAnimation.java index 45b355e..e47eb3a 100644 --- a/core/src/ch/asynk/gdx/boardgame/animations/MoveAnimation.java +++ b/core/src/ch/asynk/gdx/boardgame/animations/MoveAnimation.java @@ -104,10 +104,8 @@ public class MoveAnimation implements Animation, Pool.Poolable piece.rotate(dt.z * delta); percent += (dp * delta); - if (notify && percent >= 0.5) { - if (cb != null) { - cb.onTileChange(piece, path); - } + if (notify && cb != null && percent >= 0.5f) { + cb.onTileChange(piece, path); notify = false; } if (percent >= 1f) { -- cgit v1.1-2-g2b99