mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
minor api changes in preparation for Gui_WinLose refactoring
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 ******************
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user