mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
GUI related improves:
* GUI: fixed that choose triggers/piles dialog doesn't close correctly before cast mode choose (#8225); * GUI: fixed that some choose dialogs doesn't update battlefield state (example: choose amount, choose mana); * Game: fixed duplicated json logs at the game's end;
This commit is contained in:
parent
f31781e4a4
commit
46081d9185
11 changed files with 212 additions and 171 deletions
|
|
@ -17,9 +17,11 @@ public class AbilityPickerView implements Serializable {
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Map<UUID, String> choices = new LinkedHashMap<>();
|
||||
private String message = null;
|
||||
private String message;
|
||||
private GameView gameView;
|
||||
|
||||
public AbilityPickerView(String objectName, List<? extends Ability> abilities, String message) {
|
||||
public AbilityPickerView(GameView gameView, String objectName, List<? extends Ability> abilities, String message) {
|
||||
this.gameView = gameView;
|
||||
this.message = message;
|
||||
|
||||
int num = 0;
|
||||
|
|
@ -44,6 +46,12 @@ public class AbilityPickerView implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
public AbilityPickerView(GameView gameView, Map<UUID, String> modes, String message) {
|
||||
this.gameView = gameView;
|
||||
this.choices = modes;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
private String getAbilityRules(Ability ability, String objectName) {
|
||||
String rule = ability.getRule(objectName);
|
||||
if (rule.isEmpty()) {
|
||||
|
|
@ -55,11 +63,6 @@ public class AbilityPickerView implements Serializable {
|
|||
return rule;
|
||||
}
|
||||
|
||||
public AbilityPickerView(Map<UUID, String> modes, String message) {
|
||||
this.choices = modes;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Map<UUID, String> getChoices() {
|
||||
return choices;
|
||||
}
|
||||
|
|
@ -67,4 +70,8 @@ public class AbilityPickerView implements Serializable {
|
|||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public GameView getGameView() {
|
||||
return gameView;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class GameClientMessage implements Serializable {
|
|||
@Expose
|
||||
private GameView gameView;
|
||||
@Expose
|
||||
private CardsView cardsView;
|
||||
private CardsView cardsView1;
|
||||
@Expose
|
||||
private CardsView cardsView2;
|
||||
@Expose
|
||||
|
|
@ -32,8 +32,6 @@ public class GameClientMessage implements Serializable {
|
|||
@Expose
|
||||
private boolean flag;
|
||||
@Expose
|
||||
private String[] strings;
|
||||
@Expose
|
||||
private Set<UUID> targets;
|
||||
@Expose
|
||||
private int min;
|
||||
|
|
@ -46,64 +44,53 @@ public class GameClientMessage implements Serializable {
|
|||
@Expose
|
||||
private List<String> messages;
|
||||
|
||||
public GameClientMessage(GameView gameView) {
|
||||
public GameClientMessage(GameView gameView, Map<String, Serializable> options) {
|
||||
this.gameView = gameView;
|
||||
}
|
||||
|
||||
public GameClientMessage(GameView gameView, String message) {
|
||||
this.gameView = gameView;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public GameClientMessage(GameView gameView, String message, Map<String, Serializable> options) {
|
||||
this.gameView = gameView;
|
||||
this.message = message;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
private GameClientMessage(GameView gameView, String question, CardsView cardView, Set<UUID> targets, boolean required) {
|
||||
public GameClientMessage(GameView gameView, Map<String, Serializable> options, String message) {
|
||||
this.gameView = gameView;
|
||||
this.message = question;
|
||||
this.cardsView = cardView;
|
||||
this.options = options;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public GameClientMessage(GameView gameView, Map<String, Serializable> options, String message, CardsView cardsView1, Set<UUID> targets, boolean required) {
|
||||
this.gameView = gameView;
|
||||
this.options = options;
|
||||
this.message = message;
|
||||
this.cardsView1 = cardsView1;
|
||||
this.targets = targets;
|
||||
this.flag = required;
|
||||
}
|
||||
|
||||
public GameClientMessage(GameView gameView, String question, CardsView cardView, Set<UUID> targets, boolean required, Map<String, Serializable> options) {
|
||||
this(gameView, question, cardView, targets, required);
|
||||
public GameClientMessage(GameView gameView, Map<String, Serializable> options, String message, int min, int max) {
|
||||
this.gameView = gameView;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
public GameClientMessage(String[] choices, String message) {
|
||||
this.strings = choices;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public GameClientMessage(String message, int min, int max) {
|
||||
this.message = message;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public GameClientMessage(String message, CardsView pile1, CardsView pile2) {
|
||||
public GameClientMessage(GameView gameView, Map<String, Serializable> options, String message, CardsView pile1, CardsView pile2) {
|
||||
this.gameView = gameView;
|
||||
this.options = options;
|
||||
this.message = message;
|
||||
this.cardsView = pile1;
|
||||
this.cardsView1 = pile1;
|
||||
this.cardsView2 = pile2;
|
||||
}
|
||||
|
||||
public GameClientMessage(CardsView cardView, String name) {
|
||||
this.cardsView = cardView;
|
||||
this.message = name;
|
||||
}
|
||||
|
||||
public GameClientMessage(List<String> messages, int min, int max, Map<String, Serializable> options) {
|
||||
public GameClientMessage(GameView gameView, Map<String, Serializable> options, List<String> messages, int min, int max) {
|
||||
this.gameView = gameView;
|
||||
this.options = options;
|
||||
this.messages = messages;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
public GameClientMessage(Choice choice) {
|
||||
public GameClientMessage(GameView gameView, Map<String, Serializable> options, Choice choice) {
|
||||
this.gameView = gameView;
|
||||
this.options = options;
|
||||
this.choice = choice;
|
||||
}
|
||||
|
||||
|
|
@ -111,8 +98,12 @@ public class GameClientMessage implements Serializable {
|
|||
return gameView;
|
||||
}
|
||||
|
||||
public CardsView getCardsView() {
|
||||
return cardsView;
|
||||
public CardsView getCardsView1() {
|
||||
return cardsView1;
|
||||
}
|
||||
|
||||
public CardsView getCardsView2() {
|
||||
return cardsView2;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
|
|
@ -123,22 +114,10 @@ public class GameClientMessage implements Serializable {
|
|||
return flag;
|
||||
}
|
||||
|
||||
public String[] getStrings() {
|
||||
return strings;
|
||||
}
|
||||
|
||||
public Set<UUID> getTargets() {
|
||||
return targets;
|
||||
}
|
||||
|
||||
public CardsView getPile1() {
|
||||
return cardsView;
|
||||
}
|
||||
|
||||
public CardsView getPile2() {
|
||||
return cardsView2;
|
||||
}
|
||||
|
||||
public int getMin() {
|
||||
return min;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue