Fixed Phase stops (skipped possibility to response to spells and abilities if phase was off)

This commit is contained in:
magenoxx 2010-12-25 23:48:56 +03:00
parent b9eba43ccf
commit 9b72097827
3 changed files with 26 additions and 0 deletions

View file

@ -59,6 +59,7 @@ import mage.client.game.FeedbackPanel.FeedbackMode;
import mage.client.plugins.impl.Plugins;
import mage.client.remote.Session;
import mage.client.util.Config;
import mage.client.util.GameManager;
import mage.client.util.PhaseManager;
import mage.client.util.gui.ArrowBuilder;
import mage.util.Logging;
@ -303,6 +304,7 @@ public class GamePanel extends javax.swing.JPanel {
}
this.stack.loadCards(game.getStack(), bigCard, gameId);
GameManager.getInstance().setStackSize(game.getStack().size());
for (ExileView exile: game.getExile()) {
if (!exiles.containsKey(exile.getId())) {

View file

@ -0,0 +1,21 @@
package mage.client.util;
/**
* Controls game state on client side.
*
* @author nantuko
*/
public class GameManager {
private static GameManager fInstance = new GameManager();
public static GameManager getInstance() {
return fInstance;
}
public void setStackSize(int stackSize) {
this.stackSize = stackSize;
}
public int getStackSize() {
return stackSize;
}
private int stackSize;
}

View file

@ -62,6 +62,9 @@ public class PhaseManager {
}
public boolean isSkip(GameView gameView, String message) {
if (GameManager.getInstance().getStackSize() > 0) {
return false;
}
Map<String, String> map = gameView.getActivePlayerName().equals(DEFAULT_PLAYER_NAME) ? mapYou : mapOthers;
for (Map.Entry<String, String> entry : map.entrySet()) {
if (message.equals(entry.getKey())) {