From 72d40d7f49c52df727b627a02974a59a1a26f51d Mon Sep 17 00:00:00 2001 From: elcnesh Date: Thu, 19 Mar 2015 11:24:05 +0000 Subject: [PATCH] Re-randomise decks when starting a new match from the same lobby. --- forge-gui/src/main/java/forge/match/GameLobby.java | 4 ++-- forge-gui/src/main/java/forge/match/LocalLobby.java | 4 +++- forge-gui/src/main/java/forge/net/ClientGameLobby.java | 2 +- forge-gui/src/main/java/forge/net/ServerGameLobby.java | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/forge-gui/src/main/java/forge/match/GameLobby.java b/forge-gui/src/main/java/forge/match/GameLobby.java index 8a4f816803f..5daefd93149 100644 --- a/forge-gui/src/main/java/forge/match/GameLobby.java +++ b/forge-gui/src/main/java/forge/match/GameLobby.java @@ -134,7 +134,7 @@ public abstract class GameLobby { public abstract boolean mayControl(final int index); public abstract boolean mayRemove(final int index); protected abstract IGuiGame getGui(final int index); - protected abstract void gameStarted(); + protected abstract void onGameStarted(); public void addSlot() { final int newIndex = getNumberOfSlots(); @@ -437,7 +437,7 @@ public abstract class GameLobby { } } - gameStarted(); + onGameStarted(); } public final static class GameLobbyData implements Serializable { diff --git a/forge-gui/src/main/java/forge/match/LocalLobby.java b/forge-gui/src/main/java/forge/match/LocalLobby.java index 56740484aba..63e9857b65d 100644 --- a/forge-gui/src/main/java/forge/match/LocalLobby.java +++ b/forge-gui/src/main/java/forge/match/LocalLobby.java @@ -46,7 +46,9 @@ public final class LocalLobby extends GameLobby { return gui; } - @Override protected void gameStarted() { + @Override protected void onGameStarted() { gui = null; + // Re-randomize random decks after starting a game + updateView(true); } } diff --git a/forge-gui/src/main/java/forge/net/ClientGameLobby.java b/forge-gui/src/main/java/forge/net/ClientGameLobby.java index fbc7fe3dab9..264079011c0 100644 --- a/forge-gui/src/main/java/forge/net/ClientGameLobby.java +++ b/forge-gui/src/main/java/forge/net/ClientGameLobby.java @@ -34,6 +34,6 @@ public final class ClientGameLobby extends GameLobby { return null; } - @Override protected void gameStarted() { + @Override protected void onGameStarted() { } } diff --git a/forge-gui/src/main/java/forge/net/ServerGameLobby.java b/forge-gui/src/main/java/forge/net/ServerGameLobby.java index f5541ae4388..f85b7216093 100644 --- a/forge-gui/src/main/java/forge/net/ServerGameLobby.java +++ b/forge-gui/src/main/java/forge/net/ServerGameLobby.java @@ -64,6 +64,6 @@ public final class ServerGameLobby extends GameLobby { } @Override - protected void gameStarted() { + protected void onGameStarted() { } }