Update FControlGameEventHandler

some method don't exist on mobile port and are specifically for desktop so let those routine run for its specific platform
This commit is contained in:
Anthony Calosa
2020-04-21 17:50:25 +08:00
parent 1f7faa773c
commit 3cdbf3eb67

View File

@@ -239,17 +239,20 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
@Override @Override
public Void visit(final GameEventSpellAbilityCast event) { public Void visit(final GameEventSpellAbilityCast event) {
needStackUpdate = true; needStackUpdate = true;
processEvent(); if(GuiBase.getInterface().isLibgdxPort()) {
return processEvent(); //mobile port don't have notify stack addition like the desktop
final Runnable notifyStackAddition = new Runnable() { } else {
@Override processEvent();
public void run() {
matchController.notifyStackAddition(event);
}
};
GuiBase.getInterface().invokeInEdtLater(notifyStackAddition);
final Runnable notifyStackAddition = new Runnable() {
@Override
public void run() {
matchController.notifyStackAddition(event);
}
};
GuiBase.getInterface().invokeInEdtLater(notifyStackAddition);
}
return null; return null;
} }
@@ -262,16 +265,19 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
@Override @Override
public Void visit(final GameEventSpellRemovedFromStack event) { public Void visit(final GameEventSpellRemovedFromStack event) {
needStackUpdate = true; needStackUpdate = true;
processEvent(); if(GuiBase.getInterface().isLibgdxPort()) {
return processEvent(); //mobile port don't have notify stack addition like the desktop
final Runnable notifyStackAddition = new Runnable() { } else {
@Override processEvent();
public void run() {
matchController.notifyStackRemoval(event); final Runnable notifyStackAddition = new Runnable() {
} @Override
}; public void run() {
GuiBase.getInterface().invokeInEdtLater(notifyStackAddition); matchController.notifyStackRemoval(event);
}
};
GuiBase.getInterface().invokeInEdtLater(notifyStackAddition);
}
return null; return null;
} }
@@ -357,14 +363,12 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
@Override @Override
public Void visit(final GameEventCardChangeZone event) { public Void visit(final GameEventCardChangeZone event) {
if(event.to.getZoneType() == ZoneType.Battlefield) if(GuiBase.getInterface().isLibgdxPort()) {
refreshFieldUpdate = true; updateZone(event.from);
//pfps the change to the zones have already been performed with add and remove calls return updateZone(event.to);
// this is only for playing a sound } else {
// updateZone(event.from); return processEvent();
//return updateZone(event.to); }
return processEvent();
} }
@Override @Override
@@ -399,10 +403,11 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
@Override @Override
public Void visit(final GameEventShuffle event) { public Void visit(final GameEventShuffle event) {
//pfps the change to the library has already been performed by a setCards call if (GuiBase.getInterface().isLibgdxPort()) {
// this is only for playing a sound return updateZone(event.player.getZone(ZoneType.Library));
// return updateZone(event.player.getZone(ZoneType.Library)); } else {
return processEvent(); return processEvent();
}
} }
@Override @Override