Commit 63e9e622 authored by Drahomír Karchňák's avatar Drahomír Karchňák

#769 Refactoring.

parent 163b1ce3
......@@ -103,8 +103,9 @@ public class Action extends Image {
Touch touchUp = new Touch(event.getListenerActor(), System.currentTimeMillis());
lastTapValid = Touch.isTap(lastRecordedTouchDown, touchUp);
if (lastTapValid) {
if (lastRecordedTap == null) lastRecordedTap = touchUp;
else if (Touch.isDoubleTap(lastRecordedTap, touchUp)) {
if (lastRecordedTap == null) {
lastRecordedTap = touchUp;
} else if (Touch.isDoubleTap(lastRecordedTap, touchUp)) {
onDoubleTap();
lastRecordedTap = null;
} else {
......@@ -123,12 +124,12 @@ public class Action extends Image {
public Action(String texturePath, int orderNumber, int actionSize, float positionX, float positionY, boolean visible, AbstractTablexiaGame tablexiaGame, int actionNumber) {
super(tablexiaGame.getScreenTextureRegion(texturePath));
this.orderNumber = orderNumber;
this.actualSize = actionSize;
this.texturePath = texturePath;
this.actionNumber = actionNumber;
this.orderNumber = orderNumber;
this.actualSize = actionSize;
this.texturePath = texturePath;
this.actionNumber = actionNumber;
setBounds(positionX, positionY, actionSize, actionSize);
setBounds(positionX, positionY, actionSize, actionSize);
setOrigin(Align.center);
if (visible) {
draggable = true;
......@@ -138,7 +139,7 @@ public class Action extends Image {
setVisible(false);
}
setDragListener();
setDragListener();
initialPositionX = getX();
actionListeners = new ArrayList<ActionListener>();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment