mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
[Mobile] add Shahrazad support
This commit is contained in:
@@ -280,6 +280,21 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visit(final GameEventSubgameEnd event) {
|
||||
if (event.maingame != null) {
|
||||
for (Player p : event.maingame.getPlayers()) {
|
||||
updateZone(p, ZoneType.Battlefield);
|
||||
updateZone(p, ZoneType.Hand);
|
||||
updateZone(p, ZoneType.Graveyard);
|
||||
updateZone(p, ZoneType.Exile);
|
||||
updateZone(p, ZoneType.Command);
|
||||
}
|
||||
return processEvent();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visit(final GameEventZone event) {
|
||||
if (event.player != null) {
|
||||
|
||||
@@ -185,7 +185,7 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
|
||||
return true; //if not in game, card can be shown
|
||||
}
|
||||
if(GuiBase.getInterface().isLibgdxPort()){
|
||||
if(gameView.isGameOver()) {
|
||||
if(gameView != null && gameView.isGameOver()) {
|
||||
return true;
|
||||
}
|
||||
if(spectator!=null) { //workaround fix!! this is needed on above code or it will
|
||||
|
||||
@@ -69,6 +69,7 @@ public class HostedMatch {
|
||||
private final MatchUiEventVisitor visitor = new MatchUiEventVisitor();
|
||||
private final Map<PlayerControllerHuman, NextGameDecision> nextGameDecisions = Maps.newHashMap();
|
||||
private boolean isMatchOver = false;
|
||||
public int subGameCount = 0;
|
||||
|
||||
public HostedMatch() {}
|
||||
|
||||
@@ -362,6 +363,7 @@ public class HostedMatch {
|
||||
|
||||
@Override
|
||||
public Void visit(final GameEventSubgameStart event) {
|
||||
subGameCount++;
|
||||
event.subgame.subscribeToEvents(SoundSystem.instance);
|
||||
event.subgame.subscribeToEvents(visitor);
|
||||
|
||||
@@ -387,7 +389,10 @@ public class HostedMatch {
|
||||
}
|
||||
}
|
||||
};
|
||||
GuiBase.getInterface().invokeInEdtAndWait(switchGameView);
|
||||
if (GuiBase.getInterface().isLibgdxPort())
|
||||
GuiBase.getInterface().invokeInEdtNow(switchGameView);
|
||||
else
|
||||
GuiBase.getInterface().invokeInEdtAndWait(switchGameView);
|
||||
|
||||
//ensure opponents set properly
|
||||
for (final Player p : event.subgame.getPlayers()) {
|
||||
@@ -419,7 +424,11 @@ public class HostedMatch {
|
||||
}
|
||||
}
|
||||
};
|
||||
GuiBase.getInterface().invokeInEdtAndWait(switchGameView);
|
||||
if (GuiBase.getInterface().isLibgdxPort())
|
||||
GuiBase.getInterface().invokeInEdtNow(switchGameView);
|
||||
else
|
||||
GuiBase.getInterface().invokeInEdtAndWait(switchGameView);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user