diff --git a/Mage.Client/src/main/java/mage/client/util/layout/CardLayoutStrategy.java b/Mage.Client/src/main/java/mage/client/util/layout/CardLayoutStrategy.java deleted file mode 100644 index 9970e0c1a79..00000000000 --- a/Mage.Client/src/main/java/mage/client/util/layout/CardLayoutStrategy.java +++ /dev/null @@ -1,13 +0,0 @@ -package mage.client.util.layout; - -import javax.swing.*; - -/** - * Interface for operations that modify cards' layout - * - * @author noxx - */ -public interface CardLayoutStrategy { - - void doLayout(JLayeredPane jLayeredPane, int width); -} diff --git a/Mage.Client/src/main/java/mage/client/util/layout/ICardLayoutStrategy.java b/Mage.Client/src/main/java/mage/client/util/layout/ICardLayoutStrategy.java new file mode 100644 index 00000000000..57b8073ac23 --- /dev/null +++ b/Mage.Client/src/main/java/mage/client/util/layout/ICardLayoutStrategy.java @@ -0,0 +1,17 @@ +package mage.client.util.layout; + +import javax.swing.*; + +/** + * Interface for operations that modify cards' layout + * + * @author noxx + */ +public interface ICardLayoutStrategy { + + int getDefaultZOrder(); + + void onAdd(JLayeredPane jLayeredPane); + + void doLayout(JLayeredPane jLayeredPane, int battlefieldWidth); +} diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java b/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java index 7a451b3d1d7..ec2840bd185 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java @@ -120,11 +120,6 @@ public class CardPluginImpl implements CardPlugin { continue; } - // put enchanted lands separately - if (!empty(permanent.getLinks())) { - continue; - } - int insertIndex = -1; // Find lands with the same name. @@ -132,10 +127,6 @@ public class CardPluginImpl implements CardPlugin { Stack stack = allLands.get(i); MagePermanent firstPanel = stack.get(0); if (firstPanel.getOriginal().getName().equals(permanent.getOriginal().getName())) { - // put enchanted lands separately - if (!empty(permanent.getLinks())) { - break; - } if (!empty(firstPanel.getLinks())) { // Put this land to the left of lands with the same name and attachments. @@ -143,8 +134,8 @@ public class CardPluginImpl implements CardPlugin { break; } - if (stack.size() == landStackMax) { - // If the stack is full, put it to the right. + if (!empty(permanent.getLinks()) || stack.size() == landStackMax) { + // If this land has attachments or the stack is full, put it to the right. insertIndex = i + 1; continue; }