summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-10-18 11:08:16 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-10-18 11:08:16 +0200
commit457a018f06b2aa7ea84429e83a414b81ed848a1f (patch)
tree4faf1f3aaf7455320d388e9cac31f293a6162bd0 /core/src/ch/asynk
parent9ea06ab37a515cd413974077a6c7c3c71590edb5 (diff)
downloadgdx-boardgame-457a018f06b2aa7ea84429e83a414b81ed848a1f.zip
gdx-boardgame-457a018f06b2aa7ea84429e83a414b81ed848a1f.tar.gz
MoveAnimation : code simplification
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/animations/MoveAnimation.java6
1 files 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) {