mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
rolled back Permanent optimizations - were causing RMI exceptions
This commit is contained in:
parent
86d2086b70
commit
66a5027e94
2 changed files with 21 additions and 35 deletions
|
@ -83,32 +83,20 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
||||||
public void reset(Game game) {
|
public void reset(Game game) {
|
||||||
// when the permanent is reset copy all original values from the card
|
// when the permanent is reset copy all original values from the card
|
||||||
// must copy card each reset so that the original values don't get modified
|
// must copy card each reset so that the original values don't get modified
|
||||||
// Card copy = game.getCard(objectId).copy();
|
Card copy = game.getCard(objectId).copy();
|
||||||
copyFromCard(game.getCard(objectId));
|
copyFromCard(copy);
|
||||||
super.reset(game);
|
super.reset(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void copyFromCard(Card card) {
|
protected void copyFromCard(Card card) {
|
||||||
this.name = card.getName();
|
this.name = card.getName();
|
||||||
this.manaCost = card.getManaCost().copy();
|
this.abilities = card.getAbilities();
|
||||||
this.color = card.getColor().copy();
|
this.abilities.setControllerId(this.controllerId);
|
||||||
this.power = card.getPower().copy();
|
this.cardType = card.getCardType();
|
||||||
this.toughness = card.getToughness().copy();
|
this.color = card.getColor();
|
||||||
this.loyalty = card.getLoyalty().copy();
|
this.manaCost = card.getManaCost();
|
||||||
this.abilities = card.getAbilities().copy();
|
this.power = card.getPower();
|
||||||
this.abilities.setControllerId(controllerId);
|
this.toughness = card.getToughness();
|
||||||
this.cardType.clear();
|
|
||||||
for (CardType cType: card.getCardType()) {
|
|
||||||
this.cardType.add(cType);
|
|
||||||
}
|
|
||||||
this.subtype.clear();
|
|
||||||
for (String subType: card.getSubtype()) {
|
|
||||||
this.subtype.add(subType);
|
|
||||||
}
|
|
||||||
this.supertype.clear();
|
|
||||||
for (String superType: card.getSupertype()) {
|
|
||||||
this.supertype.add(superType);
|
|
||||||
}
|
|
||||||
if (card instanceof LevelerCard) {
|
if (card instanceof LevelerCard) {
|
||||||
LevelAbility level = ((LevelerCard)card).getLevel(this.getCounters().getCount("Level"));
|
LevelAbility level = ((LevelerCard)card).getLevel(this.getCounters().getCount("Level"));
|
||||||
if (level != null) {
|
if (level != null) {
|
||||||
|
@ -119,6 +107,8 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.subtype = card.getSubtype();
|
||||||
|
this.supertype = card.getSupertype();
|
||||||
this.art = card.getArt();
|
this.art = card.getArt();
|
||||||
this.expansionSetCode = card.getExpansionSetCode();
|
this.expansionSetCode = card.getExpansionSetCode();
|
||||||
this.rarity = card.getRarity();
|
this.rarity = card.getRarity();
|
||||||
|
|
|
@ -30,7 +30,6 @@ package mage.game.permanent;
|
||||||
|
|
||||||
import mage.game.permanent.token.Token;
|
import mage.game.permanent.token.Token;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.Constants.CardType;
|
|
||||||
import mage.Constants.Zone;
|
import mage.Constants.Zone;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
@ -57,25 +56,22 @@ public class PermanentToken extends PermanentImpl<PermanentToken> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset(Game game) {
|
public void reset(Game game) {
|
||||||
// Token copy = token.copy();
|
Token copy = token.copy();
|
||||||
copyFromToken(token);
|
copyFromToken(copy);
|
||||||
super.reset(game);
|
super.reset(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void copyFromToken(Token token) {
|
protected void copyFromToken(Token token) {
|
||||||
this.name = token.getName();
|
this.name = token.getName();
|
||||||
this.abilities = token.getAbilities().copy();
|
this.abilities.clear();
|
||||||
this.cardType.clear();
|
for (Ability ability: token.getAbilities()) {
|
||||||
for (CardType cType: token.getCardType()) {
|
this.addAbility(ability);
|
||||||
this.cardType.add(cType);
|
|
||||||
}
|
}
|
||||||
this.subtype.clear();
|
this.cardType = token.getCardType();
|
||||||
for (String subType: token.getSubtype()) {
|
this.color = token.getColor();
|
||||||
this.subtype.add(subType);
|
this.power = token.getPower();
|
||||||
}
|
this.toughness = token.getToughness();
|
||||||
this.color = token.getColor().copy();
|
this.subtype = token.getSubtype();
|
||||||
this.power = token.getPower().copy();
|
|
||||||
this.toughness = token.getToughness().copy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue