visited the quest ante code

This commit is contained in:
Maxmtg
2013-12-31 05:19:59 +00:00
parent 9d458ce8c5
commit 618cd6415d
2 changed files with 11 additions and 36 deletions

View File

@@ -145,13 +145,10 @@ public class QuestWinLose extends ControlWinLose {
if (isHumanWinner) { if (isHumanWinner) {
qc.getCards().addAllCards(anteCards); qc.getCards().addAllCards(anteCards);
this.anteWon(anteCards);
} else { } else {
for (PaperCard c : anteCards) { qc.getCards().loseCards(anteCards);
qc.getCards().loseCard(c, 1);
}
this.anteLost(anteCards);
} }
this.anteReport(anteCards, isHumanWinner);
} }
} }
@@ -219,38 +216,15 @@ public class QuestWinLose extends ControlWinLose {
return true; return true;
} }
/** private void anteReport(final List<PaperCard> antesWon, boolean hasWon) {
* <p>
* anteLost.
* </p>
* Displays cards lost to ante this game.
*
*/
private void anteLost(final List<PaperCard> antesLost) {
// Generate Swing components and attach. // Generate Swing components and attach.
this.lblTemp1 = new TitleLabel("Ante Lost: You lost the following cards in Ante:"); if(hasWon)
this.lblTemp1 = new TitleLabel("Ante Won: These cards will be available in your card pool after this match.");
else
this.lblTemp1 = new TitleLabel("Ante Lost: You lost the following cards in Ante:");
this.getView().getPnlCustom().add(this.lblTemp1, QuestWinLose.CONSTRAINTS_TITLE); this.getView().getPnlCustom().add(this.lblTemp1, QuestWinLose.CONSTRAINTS_TITLE);
this.getView().getPnlCustom().add( this.getView().getPnlCustom().add(new QuestWinLoseCardViewer(antesWon), QuestWinLose.CONSTRAINTS_CARDS);
new QuestWinLoseCardViewer(antesLost), QuestWinLose.CONSTRAINTS_CARDS);
}
/**
* <p>
* anteWon.
* </p>
* Displays cards won in ante this game (which will be added to your Card Pool).
*
*/
private void anteWon(final List<PaperCard> antesWon) {
final StringBuilder str = new StringBuilder();
str.append("Ante Won: These cards will be available in your card pool after this match.");
// Generate Swing components and attach.
this.lblTemp1 = new TitleLabel(str.toString());
this.getView().getPnlCustom().add(this.lblTemp1, QuestWinLose.CONSTRAINTS_TITLE);
this.getView().getPnlCustom().add(
new QuestWinLoseCardViewer(antesWon), QuestWinLose.CONSTRAINTS_CARDS);
} }
/** /**

View File

@@ -330,8 +330,9 @@ public final class QuestUtilCards {
* @param qty * @param qty
* quantity * quantity
*/ */
public void loseCard(final PaperCard card, int qty) { public void loseCards(final List<PaperCard> cards) {
this.sellCard(card, qty, 0, false); for(PaperCard pc: cards)
this.sellCard(pc, 1, 0, false);
} }
/** /**