minor api changes in preparation for Gui_WinLose refactoring

This commit is contained in:
Maxmtg
2011-08-14 16:26:51 +00:00
parent c5430340ca
commit f7e5897dc7
4 changed files with 21 additions and 21 deletions

View File

@@ -618,11 +618,7 @@ public class GameAction {
if (checkEndGameSate()) { if (checkEndGameSate()) {
AllZone.getDisplay().savePrefs(); AllZone.getDisplay().savePrefs();
frame.dispose(); frame.dispose();
if (!Constant.Quest.fantasyQuest[0])
new Gui_WinLose(); new Gui_WinLose();
else
new Gui_WinLose(Constant.Quest.humanList[0], Constant.Quest.computerList[0],
Constant.Quest.humanLife[0], Constant.Quest.computerLife[0]);
return; return;
} }

View File

@@ -1124,20 +1124,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
savePrefs(); savePrefs();
dispose(); dispose();
Constant.Runtime.matchState.addLose(); Constant.Runtime.matchState.addLose();
if (!Constant.Quest.fantasyQuest[0])
new Gui_WinLose(); new Gui_WinLose();
else {
//new Gui_WinLose(Constant.Quest.humanList[0], Constant.Quest.computerList[0],Constant.Quest.humanLife[0], Constant.Quest.computerLife[0]);
CardList humanList = forge.quest.data.QuestUtil.getHumanPlantAndPet(AllZone.getQuestData(), AllZone.getQuestAssignment());
CardList computerList = forge.quest.data.QuestUtil.getComputerCreatures(AllZone.getQuestData(), AllZone.getQuestAssignment());
int humanLife = AllZone.getQuestData().getLife();
int computerLife = 20;
if (AllZone.getQuestAssignment() != null)
computerLife = AllZone.getQuestAssignment().getComputerLife();
new Gui_WinLose(humanList, computerList, humanLife, computerLife);
}
} }
// ********** Phase stuff in Display ****************** // ********** Phase stuff in Display ******************

View File

@@ -370,7 +370,7 @@ public class QuestData {
/** /**
* <p>addCards.</p> * <p>addCards.</p>
*/ */
public void addCards() { public ArrayList<String> addCards() {
Generator<Card> cards = YieldUtils.toGenerator(AllZone.getCardFactory()); Generator<Card> cards = YieldUtils.toGenerator(AllZone.getCardFactory());
int nCommon = QuestPreferences.getNumCommon(); int nCommon = QuestPreferences.getNumCommon();
int nUncommon = QuestPreferences.getNumUncommon(); int nUncommon = QuestPreferences.getNumUncommon();
@@ -385,7 +385,7 @@ public class QuestData {
//getAddedCards() uses newCardList //getAddedCards() uses newCardList
newCardList = newCards; newCardList = newCards;
return newCards;
} }
/** /**

View File

@@ -143,4 +143,21 @@ public class QuestMatchState {
public boolean didWinRecently() { public boolean didWinRecently() {
return winRecently; return winRecently;
} }
/**
* <p>isMatchOver.</p>
* @return whether match is complete
*/
public boolean isMatchOver()
{
return win == 2 || lose == 2;
}
/**
* <p>isMatchOver.</p>
* @return whether match is won
*/
public boolean isMatchWon()
{
return win == 2;
}
} }