From f1667245624782eec2215df0e75e91d57e216b12 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sat, 6 Jul 2019 12:36:28 +0400 Subject: [PATCH] Fixed type cast --- Mage.Sets/src/mage/cards/v/VoraciousDragon.java | 4 ++-- .../mage/abilities/effects/common/DevourEffect.java | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/cards/v/VoraciousDragon.java b/Mage.Sets/src/mage/cards/v/VoraciousDragon.java index 55c0293f32..e19550e23f 100644 --- a/Mage.Sets/src/mage/cards/v/VoraciousDragon.java +++ b/Mage.Sets/src/mage/cards/v/VoraciousDragon.java @@ -17,8 +17,8 @@ import mage.constants.SubType; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetAnyTarget; +import mage.util.SubTypeList; -import java.util.List; import java.util.UUID; /** @@ -67,7 +67,7 @@ class TwiceDevouredGoblins implements DynamicValue { if (abilityEffect instanceof DevourEffect) { DevourEffect devourEffect = (DevourEffect) abilityEffect; int amountGoblins = 0; - for (List subtypesItem : devourEffect.getSubtypes(game, sourcePermanent.getId())) { + for (SubTypeList subtypesItem : devourEffect.getSubtypes(game, sourcePermanent.getId())) { if (subtypesItem.contains(SubType.GOBLIN)) { ++amountGoblins; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DevourEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DevourEffect.java index 2394b15275..d2d8a6a7d2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DevourEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DevourEffect.java @@ -1,4 +1,3 @@ - package mage.abilities.effects.common; import mage.abilities.Ability; @@ -25,7 +24,7 @@ import java.util.UUID; /** * Effect for the DevourAbility - * + *

* 702.81. Devour 702.81a Devour is a static ability. "Devour N" means "As this * object enters the battlefield, you may sacrifice any number of creatures. * This permanent enters the battlefield with N +1/+1 counters on it for each @@ -33,7 +32,6 @@ import java.util.UUID; * to the number of creatures the permanent devoured. "It devoured" means * "sacrificed as a result of its devour ability as it entered the battlefield." * - * * @author LevelX2 */ public class DevourEffect extends ReplacementEffectImpl { @@ -43,6 +41,7 @@ public class DevourEffect extends ReplacementEffectImpl { static { filter.add(AnotherPredicate.instance); } + private final DevourFactor devourFactor; public DevourEffect(DevourFactor devourFactor) { @@ -125,10 +124,10 @@ public class DevourEffect extends ReplacementEffectImpl { return sb.toString(); } - public List> getSubtypes(Game game, UUID permanentId) { + public List getSubtypes(Game game, UUID permanentId) { Object object = game.getState().getValue(permanentId.toString() + "devoured"); if (object != null) { - return (List>) object; + return (List) object; } return Collections.emptyList(); } @@ -136,7 +135,7 @@ public class DevourEffect extends ReplacementEffectImpl { public int getDevouredCreaturesAmount(Game game, UUID permanentId) { Object object = game.getState().getValue(permanentId.toString() + "devoured"); if (object != null) { - return ((List>) object).size(); + return ((List) object).size(); } return 0; }