Prevent mulligans resulting in face down cards

This commit is contained in:
drdev
2015-03-12 22:13:11 +00:00
parent f71a12d824
commit d5de183042
4 changed files with 12 additions and 15 deletions

View File

@@ -472,6 +472,7 @@ public final class CMatchUI
if (hand != null) {
CardPanel cp = hand.getHandArea().getCardPanel(c.getId());
if (cp != null) {
cp.setCard(c); //ensure card view updated
cp.repaintOverlays();
}
}

View File

@@ -125,14 +125,8 @@ public class CHand implements ICDoc {
}
synchronized (ordering) {
// Remove old cards from ordering
ordering.retainAll(cards);
// Append new cards to ordering
for (final CardView c : cards) {
if (!ordering.contains(c)) {
ordering.add(c);
}
}
ordering.clear();
ordering.addAll(cards);
}
final List<CardPanel> placeholders = new ArrayList<CardPanel>();
@@ -145,6 +139,9 @@ public class CHand implements ICDoc {
cardPanel.setDisplayEnabled(false);
placeholders.add(cardPanel);
}
else {
cardPanel.setCard(card); //ensure card view is updated
}
cardPanels.add(cardPanel);
}

View File

@@ -533,16 +533,15 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
/** {@inheritDoc} */
@Override
public final void setCard(final CardView cardView) {
if ((getCard() != null) && getCard().equals(cardView) && isAnimationPanel
&& imagePanel.hasImage()) {
return;
}
card = cardView;
CardView oldCard = card;
card = cardView; //always update card in case new card view instance for same card
if (imagePanel == null) {
return;
}
if (oldCard != null && oldCard.equals(card) && isAnimationPanel && imagePanel.hasImage()) {
return; //prevent unnecessary update logic for animation panel
}
updateText();
updatePTOverlay();

View File

@@ -264,7 +264,7 @@ public class FloatingCardArea extends CardArea {
cardPanel.setDisplayEnabled(true);
}
else {
cardPanel.updateImage(); //ensure image updated in case visibility changed
cardPanel.setCard(card); //ensure card view updated
}
cardPanels.add(cardPanel);
}