allow Game objects to be serialized

This commit is contained in:
betasteward 2015-05-07 10:48:44 -04:00
parent 3231688855
commit 695f274803
4 changed files with 7 additions and 4 deletions

View file

@ -28,6 +28,7 @@
package mage; package mage;
import java.io.Serializable;
import java.util.UUID; import java.util.UUID;
import mage.cards.Card; import mage.cards.Card;
import mage.game.Game; import mage.game.Game;
@ -40,7 +41,7 @@ import mage.game.stack.Spell;
* @author LevelX2 * @author LevelX2
*/ */
public class MageObjectReference implements Comparable<MageObjectReference> { public class MageObjectReference implements Comparable<MageObjectReference>, Serializable {
private final UUID sourceId; private final UUID sourceId;
private final int zoneChangeCounter; private final int zoneChangeCounter;

View file

@ -1132,7 +1132,7 @@ public class ContinuousEffects implements Serializable {
} }
} }
class ContinuousEffectSorter implements Comparator<ContinuousEffect> { class ContinuousEffectSorter implements Comparator<ContinuousEffect>, Serializable {
@Override @Override
public int compare(ContinuousEffect one, ContinuousEffect two) { public int compare(ContinuousEffect one, ContinuousEffect two) {
return Long.compare(one.getOrder(), two.getOrder()); return Long.compare(one.getOrder(), two.getOrder());

View file

@ -1,5 +1,6 @@
package mage.game; package mage.game;
import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import mage.abilities.Abilities; import mage.abilities.Abilities;
@ -10,7 +11,7 @@ import mage.counters.Counters;
* *
* @author BetaSteward * @author BetaSteward
*/ */
public class CardState { public class CardState implements Serializable {
protected boolean faceDown; protected boolean faceDown;
protected Map<String, String> info; protected Map<String, String> info;

View file

@ -28,6 +28,7 @@
package mage.game.events; package mage.game.events;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.UUID; import java.util.UUID;
import mage.constants.Zone; import mage.constants.Zone;
@ -36,7 +37,7 @@ import mage.constants.Zone;
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class GameEvent { public class GameEvent implements Serializable {
protected EventType type; protected EventType type;
protected UUID targetId; protected UUID targetId;