mirror of
https://github.com/correl/mage.git
synced 2025-04-13 01:01:11 -09:00
[WIP] SPIKE - gson @Expose
This commit is contained in:
parent
6aeb3c7c3a
commit
4b331355de
4 changed files with 31 additions and 2 deletions
Mage.Common/src/main/java/mage
|
@ -34,14 +34,20 @@ import mage.remote.interfaces.*;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.ExclusionStrategy;
|
import com.google.gson.ExclusionStrategy;
|
||||||
import com.google.gson.FieldAttributes;
|
import com.google.gson.FieldAttributes;
|
||||||
|
|
||||||
public class ActionData {
|
public class ActionData {
|
||||||
|
@Expose
|
||||||
public UUID gameId;
|
public UUID gameId;
|
||||||
|
@Expose
|
||||||
public String sessionId;
|
public String sessionId;
|
||||||
|
@Expose
|
||||||
public String type;
|
public String type;
|
||||||
|
@Expose
|
||||||
public Object value;
|
public Object value;
|
||||||
|
@Expose
|
||||||
public String message;
|
public String message;
|
||||||
|
|
||||||
public String toJson() {
|
public String toJson() {
|
||||||
|
|
|
@ -53,6 +53,8 @@ import mage.target.Target;
|
||||||
import mage.target.Targets;
|
import mage.target.Targets;
|
||||||
import mage.util.SubTypeList;
|
import mage.util.SubTypeList;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
|
@ -61,11 +63,17 @@ public class CardView extends SimpleCardView {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
protected UUID parentId;
|
protected UUID parentId;
|
||||||
|
@Expose
|
||||||
protected String name;
|
protected String name;
|
||||||
|
@Expose
|
||||||
protected String displayName;
|
protected String displayName;
|
||||||
|
@Expose
|
||||||
protected List<String> rules;
|
protected List<String> rules;
|
||||||
|
@Expose
|
||||||
protected String power;
|
protected String power;
|
||||||
|
@Expose
|
||||||
protected String toughness;
|
protected String toughness;
|
||||||
|
@Expose
|
||||||
protected String loyalty = "";
|
protected String loyalty = "";
|
||||||
protected String startingLoyalty;
|
protected String startingLoyalty;
|
||||||
protected EnumSet<CardType> cardTypes;
|
protected EnumSet<CardType> cardTypes;
|
||||||
|
@ -110,7 +118,6 @@ public class CardView extends SimpleCardView {
|
||||||
protected ArtRect artRect = ArtRect.NORMAL;
|
protected ArtRect artRect = ArtRect.NORMAL;
|
||||||
|
|
||||||
protected List<UUID> targets;
|
protected List<UUID> targets;
|
||||||
|
|
||||||
protected UUID pairedCard;
|
protected UUID pairedCard;
|
||||||
protected List<UUID> bandedCards;
|
protected List<UUID> bandedCards;
|
||||||
protected boolean paid;
|
protected boolean paid;
|
||||||
|
|
|
@ -35,6 +35,8 @@ import java.util.UUID;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
import mage.choices.Choice;
|
import mage.choices.Choice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,18 +44,29 @@ import mage.choices.Choice;
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
public class GameClientMessage implements Serializable {
|
public class GameClientMessage implements Serializable {
|
||||||
|
@Expose
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Expose
|
||||||
private GameView gameView;
|
private GameView gameView;
|
||||||
|
@Expose
|
||||||
private CardsView cardsView;
|
private CardsView cardsView;
|
||||||
|
@Expose
|
||||||
private CardsView cardsView2;
|
private CardsView cardsView2;
|
||||||
|
@Expose
|
||||||
private String message;
|
private String message;
|
||||||
|
@Expose
|
||||||
private boolean flag;
|
private boolean flag;
|
||||||
|
@Expose
|
||||||
private String[] strings;
|
private String[] strings;
|
||||||
|
@Expose
|
||||||
private Set<UUID> targets;
|
private Set<UUID> targets;
|
||||||
|
@Expose
|
||||||
private int min;
|
private int min;
|
||||||
|
@Expose
|
||||||
private int max;
|
private int max;
|
||||||
|
@Expose
|
||||||
private Map<String, Serializable> options;
|
private Map<String, Serializable> options;
|
||||||
|
@Expose
|
||||||
private Choice choice;
|
private Choice choice;
|
||||||
|
|
||||||
public GameClientMessage(GameView gameView) {
|
public GameClientMessage(GameView gameView) {
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
package mage.view;
|
package mage.view;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -36,6 +38,7 @@ import java.util.UUID;
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
public class SimpleCardView implements Serializable {
|
public class SimpleCardView implements Serializable {
|
||||||
|
@Expose
|
||||||
protected UUID id;
|
protected UUID id;
|
||||||
protected String expansionSetCode;
|
protected String expansionSetCode;
|
||||||
protected String tokenSetCode;
|
protected String tokenSetCode;
|
||||||
|
|
Loading…
Add table
Reference in a new issue