forked from External/mage
[READY FOR REVIEW] Implement a "multi-amount" dialog (#7528)
* Implemented chooseTargetAmount and new GUI dialog (distribute damage, distribute mana) * Added tests and AI support; * Test framework: added aliases support in TargetAmount dialogs; Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
This commit is contained in:
parent
042aa61ad4
commit
600cac6fc7
35 changed files with 1209 additions and 232 deletions
|
|
@ -3,6 +3,7 @@
|
|||
package mage.view;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
|
@ -42,6 +43,8 @@ public class GameClientMessage implements Serializable {
|
|||
private Map<String, Serializable> options;
|
||||
@Expose
|
||||
private Choice choice;
|
||||
@Expose
|
||||
private List<String> messages;
|
||||
|
||||
public GameClientMessage(GameView gameView) {
|
||||
this.gameView = gameView;
|
||||
|
|
@ -93,6 +96,13 @@ public class GameClientMessage implements Serializable {
|
|||
this.message = name;
|
||||
}
|
||||
|
||||
public GameClientMessage(List<String> messages, int min, int max, Map<String, Serializable> options) {
|
||||
this.messages = messages;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
public GameClientMessage(Choice choice) {
|
||||
this.choice = choice;
|
||||
}
|
||||
|
|
@ -145,6 +155,10 @@ public class GameClientMessage implements Serializable {
|
|||
return choice;
|
||||
}
|
||||
|
||||
public List<String> getMessages() {
|
||||
return messages;
|
||||
}
|
||||
|
||||
public String toJson() {
|
||||
Gson gson = new GsonBuilder()
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue