mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Undo old implementation change (caused an enchant land bug)
This commit is contained in:
parent
ffcdb51d1b
commit
4e1901166b
3 changed files with 19 additions and 24 deletions
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue