clarify comment in CPicture

This commit is contained in:
myk
2013-03-21 22:36:31 +00:00
parent 02c41195a8
commit 321282299f

View File

@@ -47,7 +47,7 @@ public enum CPicture implements ICDoc {
*/ */
public void showCard(final Card c) { public void showCard(final Card c) {
canFlip = c != null && (c.isDoubleFaced() || c.isFlipCard()); canFlip = c != null && (c.isDoubleFaced() || c.isFlipCard());
this.currentCard = c; currentCard = c;
flipped = canFlip && (c.getCurState() == CardCharacteristicName.Transformed || flipped = canFlip && (c.getCurState() == CardCharacteristicName.Transformed ||
c.getCurState() == CardCharacteristicName.Flipped); c.getCurState() == CardCharacteristicName.Flipped);
VPicture.SINGLETON_INSTANCE.getLblFlipcard().setVisible(canFlip); VPicture.SINGLETON_INSTANCE.getLblFlipcard().setVisible(canFlip);
@@ -60,13 +60,15 @@ public enum CPicture implements ICDoc {
return; return;
} }
this.currentCard = null; canFlip = false;
flipped = false;
currentCard = null;
VPicture.SINGLETON_INSTANCE.getLblFlipcard().setVisible(false); VPicture.SINGLETON_INSTANCE.getLblFlipcard().setVisible(false);
VPicture.SINGLETON_INSTANCE.getPnlPicture().setCard(item); VPicture.SINGLETON_INSTANCE.getPnlPicture().setCard(item);
} }
public Card getCurrentCard() { public Card getCurrentCard() {
return this.currentCard; return currentCard;
} }
@Override @Override
@@ -100,7 +102,8 @@ public enum CPicture implements ICDoc {
} else if (currentCard.isFlipCard()) { } else if (currentCard.isFlipCard()) {
newState = CardCharacteristicName.Flipped; newState = CardCharacteristicName.Flipped;
} else { } else {
// if this is hit, then there is a misalignment between this method and the showCard method above // if this is hit, then then showCard has been modified to handle additional types, but
// this function is missing an else if statement above
throw new RuntimeException("unhandled flippable card"); throw new RuntimeException("unhandled flippable card");
} }
} else { } else {