forked from External/mage
[refactor] moved enums from Constants class
This commit is contained in:
parent
4d16535709
commit
0bb110be45
7372 changed files with 28700 additions and 27583 deletions
|
|
@ -1,8 +1,11 @@
|
|||
package mage.abilities.effects.common.continious;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
|
@ -12,7 +15,7 @@ import mage.game.permanent.Permanent;
|
|||
public class ControlEnchantedEffect extends ContinuousEffectImpl<ControlEnchantedEffect> {
|
||||
|
||||
public ControlEnchantedEffect() {
|
||||
super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.GainControl);
|
||||
super(Duration.WhileOnBattlefield, Outcome.GainControl);
|
||||
staticText = "You control enchanted creature";
|
||||
}
|
||||
|
||||
|
|
@ -26,14 +29,14 @@ public class ControlEnchantedEffect extends ContinuousEffectImpl<ControlEnchante
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Constants.Layer layer, Constants.SubLayer sublayer, Ability source, Game game) {
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
Permanent permanent = game.getPermanent(enchantment.getAttachedTo());
|
||||
if (permanent != null) {
|
||||
switch (layer) {
|
||||
case ControlChangingEffects_2:
|
||||
if (sublayer == Constants.SubLayer.NA) {
|
||||
if (sublayer == SubLayer.NA) {
|
||||
permanent.changeControllerId(source.getControllerId(), game);
|
||||
}
|
||||
break;
|
||||
|
|
@ -50,8 +53,8 @@ public class ControlEnchantedEffect extends ContinuousEffectImpl<ControlEnchante
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLayer(Constants.Layer layer) {
|
||||
return layer == Constants.Layer.ControlChangingEffects_2;
|
||||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.ControlChangingEffects_2;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue