Add move throw sync
This commit is contained in:
@@ -23,7 +23,11 @@ public class ModelSynchronizer {
|
||||
}
|
||||
|
||||
public void animationEnd() {
|
||||
app.getGameLogic().selectAnimationEnd();
|
||||
if(app.getNotificationSynchronizer().waitForAnimation) {
|
||||
app.getNotificationSynchronizer().waitForAnimation = false;
|
||||
} else {
|
||||
app.getGameLogic().selectAnimationEnd();
|
||||
}
|
||||
}
|
||||
|
||||
public void select(UUID a, UUID b){
|
||||
@@ -94,7 +98,7 @@ public void confirm() {
|
||||
a = null;
|
||||
b = null;
|
||||
card = null;
|
||||
|
||||
|
||||
gameView.noConfirm();
|
||||
gameView.hideNoPower();
|
||||
}
|
||||
|
||||
@@ -22,12 +22,18 @@ public class NotificationSynchronizer {
|
||||
|
||||
private static final float STANDARD_DELAY = 2.5f;
|
||||
|
||||
public boolean waitForAnimation = false;
|
||||
|
||||
NotificationSynchronizer(MdgaApp app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
public void update() {
|
||||
while (timer.getTimeInSeconds() >= delay) {
|
||||
if(waitForAnimation) {
|
||||
return;
|
||||
}
|
||||
|
||||
Notification n = app.getGameLogic().getNotification();
|
||||
|
||||
if(n == null) {
|
||||
@@ -161,6 +167,7 @@ private void handleGame(Notification notification) {
|
||||
guiHandler.hideText();
|
||||
} else if (notification instanceof ThrowPieceNotification n) {
|
||||
boardHandler.throwPiece(n.getPieceId(), n.getThrowColor());
|
||||
waitForAnimation = true;
|
||||
} else if (notification instanceof NoShieldNotification n) {
|
||||
boardHandler.unshieldPiece(n.getPieceId());
|
||||
} else if (notification instanceof PlayCardNotification n) {
|
||||
|
||||
Reference in New Issue
Block a user