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) { if (hand != null) {
CardPanel cp = hand.getHandArea().getCardPanel(c.getId()); CardPanel cp = hand.getHandArea().getCardPanel(c.getId());
if (cp != null) { if (cp != null) {
cp.setCard(c); //ensure card view updated
cp.repaintOverlays(); cp.repaintOverlays();
} }
} }

View File

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

View File

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

View File

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