[WIP] SPIKE - gson @Expose

This commit is contained in:
Shaun Hannah 2018-02-26 19:24:00 -05:00
parent 6aeb3c7c3a
commit 4b331355de
4 changed files with 31 additions and 2 deletions

View file

@ -34,14 +34,20 @@ import mage.remote.interfaces.*;
import java.util.UUID;
import com.google.gson.annotations.Expose;
import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
public class ActionData {
@Expose
public UUID gameId;
@Expose
public String sessionId;
@Expose
public String type;
@Expose
public Object value;
@Expose
public String message;
public String toJson() {

View file

@ -53,6 +53,8 @@ import mage.target.Target;
import mage.target.Targets;
import mage.util.SubTypeList;
import com.google.gson.annotations.Expose;
/**
* @author BetaSteward_at_googlemail.com
*/
@ -61,11 +63,17 @@ public class CardView extends SimpleCardView {
private static final long serialVersionUID = 1L;
protected UUID parentId;
@Expose
protected String name;
@Expose
protected String displayName;
@Expose
protected List<String> rules;
@Expose
protected String power;
@Expose
protected String toughness;
@Expose
protected String loyalty = "";
protected String startingLoyalty;
protected EnumSet<CardType> cardTypes;
@ -110,7 +118,6 @@ public class CardView extends SimpleCardView {
protected ArtRect artRect = ArtRect.NORMAL;
protected List<UUID> targets;
protected UUID pairedCard;
protected List<UUID> bandedCards;
protected boolean paid;

View file

@ -35,6 +35,8 @@ import java.util.UUID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;
import mage.choices.Choice;
/**
@ -42,18 +44,29 @@ import mage.choices.Choice;
* @author BetaSteward_at_googlemail.com
*/
public class GameClientMessage implements Serializable {
@Expose
private static final long serialVersionUID = 1L;
@Expose
private GameView gameView;
@Expose
private CardsView cardsView;
@Expose
private CardsView cardsView2;
@Expose
private String message;
@Expose
private boolean flag;
@Expose
private String[] strings;
@Expose
private Set<UUID> targets;
@Expose
private int min;
@Expose
private int max;
@Expose
private Map<String, Serializable> options;
@Expose
private Choice choice;
public GameClientMessage(GameView gameView) {

View file

@ -28,6 +28,8 @@
package mage.view;
import com.google.gson.annotations.Expose;
import java.io.Serializable;
import java.util.UUID;
@ -36,6 +38,7 @@ import java.util.UUID;
* @author BetaSteward_at_googlemail.com
*/
public class SimpleCardView implements Serializable {
@Expose
protected UUID id;
protected String expansionSetCode;
protected String tokenSetCode;