* Marshland Bloodcaster - fixed game freeze on usage;

* Kentaro, the Smiling Cat - fixed game freeze on usage;
This commit is contained in:
Oleg Agafonov 2021-08-02 17:40:35 +04:00
parent 042b58dc5d
commit a5b41ea920
2 changed files with 22 additions and 5 deletions

View file

@ -60,6 +60,21 @@ public class SerializationTest extends CardTestPlayerBase {
Assert.assertEquals("Must get infected counter", 1, permanent.getCounters(currentGame).getCount(CounterType.M1M1));
}
@Test
public void test_Single_KentaroTheSmilingCat() {
CardInfo cardInfo = CardRepository.instance.findCard("Kentaro, the Smiling Cat");
Card newCard = cardInfo.getCard();
Card permCard = CardUtil.getDefaultCardSideForBattlefield(newCard);
PermanentImpl permanent = new PermanentCard(permCard, playerA.getId(), currentGame);
currentGame.addPermanent(permanent, 0);
// test compress (it uses default java serialization)
Object compressed = CompressUtil.compress(permanent);
Assert.assertTrue("Must be zip", compressed instanceof ZippedObjectImpl);
PermanentImpl uncompressed = (PermanentImpl) CompressUtil.decompress(compressed);
Assert.assertEquals("Must be same", permanent.getName(), uncompressed.getName());
}
@Test
public void test_LondonMulligan() {
LondonMulligan mulligan = new LondonMulligan(15);

View file

@ -3,10 +3,12 @@ package mage.abilities.costs;
import mage.abilities.Ability;
import mage.game.Game;
public interface DynamicCost {
Cost getCost(Ability ability, Game game);
String getText(Ability ability, Game game);
import java.io.Serializable;
public interface DynamicCost extends Serializable {
Cost getCost(Ability ability, Game game);
String getText(Ability ability, Game game);
}