mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Fixed Phase stops (skipped possibility to response to spells and abilities if phase was off)
This commit is contained in:
parent
b9eba43ccf
commit
9b72097827
3 changed files with 26 additions and 0 deletions
|
|
@ -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())) {
|
||||
|
|
|
|||
21
Mage.Client/src/main/java/mage/client/util/GameManager.java
Normal file
21
Mage.Client/src/main/java/mage/client/util/GameManager.java
Normal 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;
|
||||
}
|
||||
|
|
@ -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())) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue