[mage.card.plugin] enhanced sorting caching (no blinking on every phase)

This commit is contained in:
magenoxx 2010-12-27 00:36:27 +03:00
parent 7bc6a97a44
commit 5bdfd1b467
2 changed files with 4 additions and 11 deletions

View file

@ -65,9 +65,8 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
static private final float rotCenterToBottomCorner = 0.7071067811865475244008443621048f; static private final float rotCenterToBottomCorner = 0.7071067811865475244008443621048f;
public CardView gameCard; public CardView gameCard;
public PermanentView gamePermanent; //public List<CardPanel> attachedPanels = new ArrayList();
public CardPanel attachedToPanel; private List<MagePermanent> links = new ArrayList<MagePermanent>();
public List<CardPanel> attachedPanels = new ArrayList();
public double tappedAngle = 0; public double tappedAngle = 0;
public ScaledImagePanel imagePanel; public ScaledImagePanel imagePanel;
public ImagePanel overlayPanel; public ImagePanel overlayPanel;
@ -101,8 +100,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
this.isPermanent = this.gameCard instanceof PermanentView; this.isPermanent = this.gameCard instanceof PermanentView;
if (isPermanent) { if (isPermanent) {
this.gamePermanent = (PermanentView) this.gameCard; this.hasSickness = ((PermanentView) this.gameCard).hasSummoningSickness();
this.hasSickness = this.gamePermanent.hasSummoningSickness();
} }
//for container debug (don't remove) //for container debug (don't remove)
@ -456,12 +454,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
@Override @Override
public List<MagePermanent> getLinks() { public List<MagePermanent> getLinks() {
List<MagePermanent> list = new ArrayList<MagePermanent>(); return links;
if (attachedPanels == null) return list;
for (MagePermanent p : attachedPanels) {
list.add(p);
}
return list;
} }
@Override @Override