From 321282299fc3715be6a9d2766e17cc7450756a34 Mon Sep 17 00:00:00 2001 From: myk Date: Thu, 21 Mar 2013 22:36:31 +0000 Subject: [PATCH] clarify comment in CPicture --- .../java/forge/gui/match/controllers/CPicture.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/forge/gui/match/controllers/CPicture.java b/src/main/java/forge/gui/match/controllers/CPicture.java index 368bcad6e90..8dae6eb2f74 100644 --- a/src/main/java/forge/gui/match/controllers/CPicture.java +++ b/src/main/java/forge/gui/match/controllers/CPicture.java @@ -47,7 +47,7 @@ public enum CPicture implements ICDoc { */ public void showCard(final Card c) { canFlip = c != null && (c.isDoubleFaced() || c.isFlipCard()); - this.currentCard = c; + currentCard = c; flipped = canFlip && (c.getCurState() == CardCharacteristicName.Transformed || c.getCurState() == CardCharacteristicName.Flipped); VPicture.SINGLETON_INSTANCE.getLblFlipcard().setVisible(canFlip); @@ -59,14 +59,16 @@ public enum CPicture implements ICDoc { showCard(((IPaperCard)item).getMatchingForgeCard()); return; } - - this.currentCard = null; + + canFlip = false; + flipped = false; + currentCard = null; VPicture.SINGLETON_INSTANCE.getLblFlipcard().setVisible(false); VPicture.SINGLETON_INSTANCE.getPnlPicture().setCard(item); } public Card getCurrentCard() { - return this.currentCard; + return currentCard; } @Override @@ -100,7 +102,8 @@ public enum CPicture implements ICDoc { } else if (currentCard.isFlipCard()) { newState = CardCharacteristicName.Flipped; } 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"); } } else {