mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Add Statistics screen for Planar Conquest
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1353,6 +1353,7 @@ forge-gui-mobile/src/forge/screens/planarconquest/ConquestPlaneswalkScreen.java
|
|||||||
forge-gui-mobile/src/forge/screens/planarconquest/ConquestPlaneswalkersScreen.java -text
|
forge-gui-mobile/src/forge/screens/planarconquest/ConquestPlaneswalkersScreen.java -text
|
||||||
forge-gui-mobile/src/forge/screens/planarconquest/ConquestPrefsScreen.java -text
|
forge-gui-mobile/src/forge/screens/planarconquest/ConquestPrefsScreen.java -text
|
||||||
forge-gui-mobile/src/forge/screens/planarconquest/ConquestRewardDialog.java -text
|
forge-gui-mobile/src/forge/screens/planarconquest/ConquestRewardDialog.java -text
|
||||||
|
forge-gui-mobile/src/forge/screens/planarconquest/ConquestStatsScreen.java -text
|
||||||
forge-gui-mobile/src/forge/screens/planarconquest/LoadConquestScreen.java -text
|
forge-gui-mobile/src/forge/screens/planarconquest/LoadConquestScreen.java -text
|
||||||
forge-gui-mobile/src/forge/screens/planarconquest/NewConquestScreen.java -text
|
forge-gui-mobile/src/forge/screens/planarconquest/NewConquestScreen.java -text
|
||||||
forge-gui-mobile/src/forge/screens/planarconquest/NewConquestScreenModel.java -text
|
forge-gui-mobile/src/forge/screens/planarconquest/NewConquestScreenModel.java -text
|
||||||
@@ -19000,6 +19001,7 @@ forge-gui/src/main/java/forge/planarconquest/ConquestRecord.java -text
|
|||||||
forge-gui/src/main/java/forge/planarconquest/ConquestRegion.java -text
|
forge-gui/src/main/java/forge/planarconquest/ConquestRegion.java -text
|
||||||
forge-gui/src/main/java/forge/planarconquest/ConquestReward.java -text
|
forge-gui/src/main/java/forge/planarconquest/ConquestReward.java -text
|
||||||
forge-gui/src/main/java/forge/planarconquest/ConquestUtil.java -text
|
forge-gui/src/main/java/forge/planarconquest/ConquestUtil.java -text
|
||||||
|
forge-gui/src/main/java/forge/planarconquest/IVConquestStats.java -text
|
||||||
forge-gui/src/main/java/forge/player/GamePlayerUtil.java -text
|
forge-gui/src/main/java/forge/player/GamePlayerUtil.java -text
|
||||||
forge-gui/src/main/java/forge/player/HumanCostDecision.java -text
|
forge-gui/src/main/java/forge/player/HumanCostDecision.java -text
|
||||||
forge-gui/src/main/java/forge/player/HumanPlay.java -text
|
forge-gui/src/main/java/forge/player/HumanPlay.java -text
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public class ConquestMenu extends FPopupMenu {
|
|||||||
private static final ConquestPlaneswalkersScreen planeswalkersScreen = new ConquestPlaneswalkersScreen();
|
private static final ConquestPlaneswalkersScreen planeswalkersScreen = new ConquestPlaneswalkersScreen();
|
||||||
private static final ConquestCollectionScreen collectionScreen = new ConquestCollectionScreen();
|
private static final ConquestCollectionScreen collectionScreen = new ConquestCollectionScreen();
|
||||||
private static final ConquestPlaneswalkScreen planeswalkScreen = new ConquestPlaneswalkScreen();
|
private static final ConquestPlaneswalkScreen planeswalkScreen = new ConquestPlaneswalkScreen();
|
||||||
|
private static final ConquestStatsScreen statsScreen = new ConquestStatsScreen();
|
||||||
private static final ConquestPrefsScreen prefsScreen = new ConquestPrefsScreen();
|
private static final ConquestPrefsScreen prefsScreen = new ConquestPrefsScreen();
|
||||||
|
|
||||||
private static final FMenuItem multiverseItem = new FMenuItem("The Multiverse", FSkinImage.MULTIVERSE, new FEventHandler() {
|
private static final FMenuItem multiverseItem = new FMenuItem("The Multiverse", FSkinImage.MULTIVERSE, new FEventHandler() {
|
||||||
@@ -54,6 +55,12 @@ public class ConquestMenu extends FPopupMenu {
|
|||||||
setCurrentScreen(collectionScreen);
|
setCurrentScreen(collectionScreen);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
private static final FMenuItem statsItem = new FMenuItem("Statistics", FSkinImage.MULTI, new FEventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent(FEvent e) {
|
||||||
|
setCurrentScreen(statsScreen);
|
||||||
|
}
|
||||||
|
});
|
||||||
private static final FMenuItem planeswalkItem = new FMenuItem("Planeswalk", FSkinImage.PW_BADGE_COMMON, new FEventHandler() {
|
private static final FMenuItem planeswalkItem = new FMenuItem("Planeswalk", FSkinImage.PW_BADGE_COMMON, new FEventHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(FEvent e) {
|
public void handleEvent(FEvent e) {
|
||||||
@@ -118,6 +125,7 @@ public class ConquestMenu extends FPopupMenu {
|
|||||||
addItem(commandersItem); commandersItem.setSelected(currentScreen == commandersScreen);
|
addItem(commandersItem); commandersItem.setSelected(currentScreen == commandersScreen);
|
||||||
addItem(planeswalkersItem); planeswalkersItem.setSelected(currentScreen == planeswalkersScreen);
|
addItem(planeswalkersItem); planeswalkersItem.setSelected(currentScreen == planeswalkersScreen);
|
||||||
addItem(collectionItem); collectionItem.setSelected(currentScreen == collectionScreen);
|
addItem(collectionItem); collectionItem.setSelected(currentScreen == collectionScreen);
|
||||||
|
addItem(statsItem); statsItem.setSelected(currentScreen == statsScreen);
|
||||||
addItem(planeswalkItem); planeswalkItem.setSelected(currentScreen == planeswalkScreen);
|
addItem(planeswalkItem); planeswalkItem.setSelected(currentScreen == planeswalkScreen);
|
||||||
addItem(prefsItem); prefsItem.setSelected(currentScreen == prefsScreen);
|
addItem(prefsItem); prefsItem.setSelected(currentScreen == prefsScreen);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,137 @@
|
|||||||
|
package forge.screens.planarconquest;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||||
|
|
||||||
|
import forge.assets.FImage;
|
||||||
|
import forge.assets.FSkinFont;
|
||||||
|
import forge.assets.FSkinImage;
|
||||||
|
import forge.interfaces.IButton;
|
||||||
|
import forge.model.FModel;
|
||||||
|
import forge.planarconquest.ConquestData;
|
||||||
|
import forge.planarconquest.ConquestPlane;
|
||||||
|
import forge.planarconquest.IVConquestStats;
|
||||||
|
import forge.screens.FScreen;
|
||||||
|
import forge.toolbox.FComboBox;
|
||||||
|
import forge.toolbox.FDisplayObject;
|
||||||
|
import forge.toolbox.FEvent;
|
||||||
|
import forge.toolbox.FEvent.FEventHandler;
|
||||||
|
import forge.toolbox.FLabel;
|
||||||
|
import forge.toolbox.FScrollPane;
|
||||||
|
import forge.util.Utils;
|
||||||
|
|
||||||
|
public class ConquestStatsScreen extends FScreen implements IVConquestStats {
|
||||||
|
private static final float PADDING = Utils.scale(5f);
|
||||||
|
|
||||||
|
private final FComboBox<Object> cbPlanes = add(new FComboBox<Object>());
|
||||||
|
private final FScrollPane scroller = add(new FScrollPane() {
|
||||||
|
@Override
|
||||||
|
protected ScrollBounds layoutAndGetScrollBounds(float visibleWidth, float visibleHeight) {
|
||||||
|
float x = 0;
|
||||||
|
float y = 0;
|
||||||
|
float w = visibleWidth;
|
||||||
|
float h = lblAEtherShards.getAutoSizeBounds().height;
|
||||||
|
for (FDisplayObject lbl : getChildren()) {
|
||||||
|
if (lbl.isVisible()) {
|
||||||
|
lbl.setBounds(x, y, w, lbl.getHeight() == 0 ? h : lbl.getHeight()); //respect height override if set
|
||||||
|
y += lbl.getHeight() + PADDING;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new ScrollBounds(visibleWidth, y);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
private final FLabel lblAEtherShards = scroller.add(new StatLabel(FSkinImage.AETHER_SHARD));
|
||||||
|
private final FLabel lblPlaneswalkEmblems = scroller.add(new StatLabel(FSkinImage.PW_BADGE_COMMON));
|
||||||
|
private final FLabel lblTotalWins = scroller.add(new StatLabel(FSkinImage.QUEST_PLUS));
|
||||||
|
private final FLabel lblTotalLosses = scroller.add(new StatLabel(FSkinImage.QUEST_MINUS));
|
||||||
|
private final FLabel lblConqueredEvents = scroller.add(new StatLabel(FSkinImage.MULTIVERSE));
|
||||||
|
private final FLabel lblUnlockedCards = scroller.add(new StatLabel(FSkinImage.SPELLBOOK));
|
||||||
|
private final FLabel lblCommanders = scroller.add(new StatLabel(FSkinImage.COMMANDER));
|
||||||
|
private final FLabel lblPlaneswalkers = scroller.add(new StatLabel(FSkinImage.PLANESWALKER));
|
||||||
|
|
||||||
|
public ConquestStatsScreen() {
|
||||||
|
super(null, ConquestMenu.getMenu());
|
||||||
|
|
||||||
|
cbPlanes.addItem("All Planes");
|
||||||
|
for (ConquestPlane plane : FModel.getPlanes()) {
|
||||||
|
if (!plane.isUnreachable()) {
|
||||||
|
cbPlanes.addItem(plane);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cbPlanes.setAlignment(HAlignment.CENTER);
|
||||||
|
cbPlanes.setChangedHandler(new FEventHandler() {
|
||||||
|
@Override
|
||||||
|
public void handleEvent(FEvent e) {
|
||||||
|
ConquestPlane plane = cbPlanes.getSelectedIndex() > 0 ? (ConquestPlane)cbPlanes.getSelectedItem() : null;
|
||||||
|
FModel.getConquest().getModel().updateStatLabels(ConquestStatsScreen.this, plane);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivate() {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update() {
|
||||||
|
ConquestData model = FModel.getConquest().getModel();
|
||||||
|
setHeaderCaption(model.getName());
|
||||||
|
|
||||||
|
//update plane selector to show current plane
|
||||||
|
FEventHandler handler = cbPlanes.getChangedHandler();
|
||||||
|
cbPlanes.setChangedHandler(null); //temporarily clear to prevent updating plane stats twice
|
||||||
|
cbPlanes.setSelectedItem(model.getCurrentPlane());
|
||||||
|
cbPlanes.setChangedHandler(handler);
|
||||||
|
|
||||||
|
model.updateStatLabels(this, model.getCurrentPlane());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doLayout(float startY, float width, float height) {
|
||||||
|
float x = PADDING;
|
||||||
|
float y = startY + PADDING;
|
||||||
|
width -= 2 * x;
|
||||||
|
|
||||||
|
cbPlanes.setBounds(x, y, width, cbPlanes.getHeight());
|
||||||
|
y += cbPlanes.getHeight() + PADDING;
|
||||||
|
scroller.setBounds(x, y, width, height - PADDING - y);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IButton getLblAEtherShards() {
|
||||||
|
return lblAEtherShards;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public IButton getLblPlaneswalkEmblems() {
|
||||||
|
return lblPlaneswalkEmblems;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public IButton getLblTotalWins() {
|
||||||
|
return lblTotalWins;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public IButton getLblTotalLosses() {
|
||||||
|
return lblTotalLosses;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public IButton getLblConqueredEvents() {
|
||||||
|
return lblConqueredEvents;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public IButton getLblUnlockedCards() {
|
||||||
|
return lblUnlockedCards;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public IButton getLblCommanders() {
|
||||||
|
return lblCommanders;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public IButton getLblPlaneswalkers() {
|
||||||
|
return lblPlaneswalkers;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class StatLabel extends FLabel {
|
||||||
|
private StatLabel(FImage icon0) {
|
||||||
|
super(new FLabel.Builder().icon(icon0).font(FSkinFont.get(14)).iconScaleFactor(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -308,7 +308,7 @@ public class LoadConquestScreen extends LaunchScreen {
|
|||||||
float iconSize = h + Utils.scale(2);
|
float iconSize = h + Utils.scale(2);
|
||||||
float iconOffset = SettingsScreen.SETTING_PADDING - Utils.scale(2);
|
float iconOffset = SettingsScreen.SETTING_PADDING - Utils.scale(2);
|
||||||
|
|
||||||
String cards = String.valueOf(value.getUnlockedCount());
|
String cards = String.valueOf(value.getUnlockedCardCount());
|
||||||
String shards = String.valueOf(value.getAEtherShards());
|
String shards = String.valueOf(value.getAEtherShards());
|
||||||
font = FSkinFont.get(12);
|
font = FSkinFont.get(12);
|
||||||
float cardsWidth = font.getBounds(cards).width + iconSize + SettingsScreen.SETTING_PADDING;
|
float cardsWidth = font.getBounds(cards).width + iconSize + SettingsScreen.SETTING_PADDING;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package forge.screens.quest;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import forge.assets.FImage;
|
||||||
import forge.assets.FSkinFont;
|
import forge.assets.FSkinFont;
|
||||||
import forge.assets.FSkinImage;
|
import forge.assets.FSkinImage;
|
||||||
import forge.interfaces.IButton;
|
import forge.interfaces.IButton;
|
||||||
@@ -41,24 +42,12 @@ public class QuestStatsScreen extends FScreen {
|
|||||||
return new ScrollBounds(visibleWidth, y);
|
return new ScrollBounds(visibleWidth, y);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
private final FLabel lblWins = scroller.add(new FLabel.Builder()
|
private final FLabel lblWins = scroller.add(new StatLabel(FSkinImage.QUEST_PLUS));
|
||||||
.icon(FSkinImage.QUEST_PLUS)
|
private final FLabel lblLosses = scroller.add(new StatLabel(FSkinImage.QUEST_MINUS));
|
||||||
.font(FSkinFont.get(16)).iconScaleFactor(1).build());
|
private final FLabel lblCredits = scroller.add(new StatLabel(FSkinImage.QUEST_COINSTACK));
|
||||||
private final FLabel lblLosses = scroller.add(new FLabel.Builder()
|
private final FLabel lblWinStreak = scroller.add(new StatLabel(FSkinImage.QUEST_PLUSPLUS));
|
||||||
.icon(FSkinImage.QUEST_MINUS)
|
private final FLabel lblLife = scroller.add(new StatLabel(FSkinImage.QUEST_LIFE));
|
||||||
.font(FSkinFont.get(16)).iconScaleFactor(1).build());
|
private final FLabel lblWorld = scroller.add(new StatLabel(FSkinImage.QUEST_MAP));
|
||||||
private final FLabel lblCredits = scroller.add(new FLabel.Builder()
|
|
||||||
.icon(FSkinImage.QUEST_COINSTACK)
|
|
||||||
.font(FSkinFont.get(16)).iconScaleFactor(1).build());
|
|
||||||
private final FLabel lblWinStreak = scroller.add(new FLabel.Builder()
|
|
||||||
.icon(FSkinImage.QUEST_PLUSPLUS)
|
|
||||||
.font(FSkinFont.get(16)).iconScaleFactor(1).build());
|
|
||||||
private final FLabel lblLife = scroller.add(new FLabel.Builder()
|
|
||||||
.icon(FSkinImage.QUEST_LIFE)
|
|
||||||
.font(FSkinFont.get(16)).iconScaleFactor(1).build());
|
|
||||||
private final FLabel lblWorld = scroller.add(new FLabel.Builder()
|
|
||||||
.icon(FSkinImage.QUEST_MAP)
|
|
||||||
.font(FSkinFont.get(16)).iconScaleFactor(1).build());
|
|
||||||
private final FComboBox<String> cbxPet = scroller.add(new FComboBox<String>());
|
private final FComboBox<String> cbxPet = scroller.add(new FComboBox<String>());
|
||||||
private final FComboBox<String> cbxMatchLength = new FComboBox<String>();
|
private final FComboBox<String> cbxMatchLength = new FComboBox<String>();
|
||||||
private final FCheckBox cbPlant = scroller.add(new FCheckBox("Summon Plant"));
|
private final FCheckBox cbPlant = scroller.add(new FCheckBox("Summon Plant"));
|
||||||
@@ -157,4 +146,10 @@ public class QuestStatsScreen extends FScreen {
|
|||||||
protected void doLayout(float startY, float width, float height) {
|
protected void doLayout(float startY, float width, float height) {
|
||||||
scroller.setBounds(0, startY, width, height - startY);
|
scroller.setBounds(0, startY, width, height - startY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static class StatLabel extends FLabel {
|
||||||
|
private StatLabel(FImage icon0) {
|
||||||
|
super(new FLabel.Builder().icon(icon0).font(FSkinFont.get(16)).iconScaleFactor(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ public final class ConquestData {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUnlockedCount() {
|
public int getUnlockedCardCount() {
|
||||||
return unlockedCards.size();
|
return unlockedCards.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,6 +384,95 @@ public final class ConquestData {
|
|||||||
return chaosBattleRecord;
|
return chaosBattleRecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateStatLabels(IVConquestStats view, ConquestPlane plane) {
|
||||||
|
int wins = 0;
|
||||||
|
int losses = 0;
|
||||||
|
int conqueredCount = 0;
|
||||||
|
int totalEventCount = 0;
|
||||||
|
int unlockedCardCount = 0;
|
||||||
|
int totalCardCount = 0;
|
||||||
|
int commanderCount = 0;
|
||||||
|
int totalCommanderCount = 0;
|
||||||
|
int planeswalkerCount = 0;
|
||||||
|
int totalPlaneswalkerCount = 0;
|
||||||
|
|
||||||
|
if (plane != null) {
|
||||||
|
ConquestPlaneData planeData = planeDataMap.get(plane.getName());
|
||||||
|
if (planeData != null) {
|
||||||
|
wins = planeData.getTotalWins();
|
||||||
|
losses = planeData.getTotalLosses();
|
||||||
|
conqueredCount = planeData.getConqueredCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ConquestCommander commander : commanders) {
|
||||||
|
if (plane.getCommanders().contains(commander.getCard())) {
|
||||||
|
commanderCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
totalEventCount = plane.getEventCount();
|
||||||
|
totalCardCount = plane.getCardPool().size();
|
||||||
|
totalCommanderCount = plane.getCommanders().size();
|
||||||
|
|
||||||
|
for (PaperCard card : plane.getCardPool().getAllCards()) {
|
||||||
|
boolean unlocked = hasUnlockedCard(card);
|
||||||
|
if (unlocked) {
|
||||||
|
unlockedCardCount++;
|
||||||
|
}
|
||||||
|
if (card.getRules().getType().isPlaneswalker()) {
|
||||||
|
if (unlocked) {
|
||||||
|
planeswalkerCount++;
|
||||||
|
}
|
||||||
|
totalPlaneswalkerCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (ConquestPlane p : FModel.getPlanes()) {
|
||||||
|
ConquestPlaneData planeData = planeDataMap.get(p.getName());
|
||||||
|
if (planeData != null) {
|
||||||
|
wins += planeData.getTotalWins();
|
||||||
|
losses += planeData.getTotalLosses();
|
||||||
|
conqueredCount += planeData.getConqueredCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
totalEventCount += p.getEventCount();
|
||||||
|
totalCardCount += p.getCardPool().size();
|
||||||
|
totalCommanderCount += p.getCommanders().size();
|
||||||
|
|
||||||
|
for (PaperCard card : p.getCardPool().getAllCards()) {
|
||||||
|
boolean unlocked = hasUnlockedCard(card);
|
||||||
|
if (unlocked) {
|
||||||
|
unlockedCardCount++;
|
||||||
|
}
|
||||||
|
if (card.getRules().getType().isPlaneswalker()) {
|
||||||
|
if (unlocked) {
|
||||||
|
planeswalkerCount++;
|
||||||
|
}
|
||||||
|
totalPlaneswalkerCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
commanderCount = commanders.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
view.getLblAEtherShards().setText("AEther Shards: " + aetherShards);
|
||||||
|
view.getLblPlaneswalkEmblems().setText("Planeswalk Emblems: " + planeswalkEmblems);
|
||||||
|
view.getLblTotalWins().setText("Total Wins: " + wins);
|
||||||
|
view.getLblTotalLosses().setText("Total Losses: " + losses);
|
||||||
|
view.getLblConqueredEvents().setText("Conquered Events: " + formatRatio(conqueredCount, totalEventCount));
|
||||||
|
view.getLblUnlockedCards().setText("Unlocked Cards: " + formatRatio(unlockedCardCount, totalCardCount));
|
||||||
|
view.getLblCommanders().setText("Commanders: " + formatRatio(commanderCount, totalCommanderCount));
|
||||||
|
view.getLblPlaneswalkers().setText("Planeswalkers: " + formatRatio(planeswalkerCount, totalPlaneswalkerCount));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String formatRatio(int numerator, int denominator) {
|
||||||
|
if (denominator == 0) {
|
||||||
|
return "0 / 0 (0%)";
|
||||||
|
}
|
||||||
|
return numerator + " / " + denominator + " (" + Math.round(100f * (float)numerator / (float)denominator) + "%)";
|
||||||
|
}
|
||||||
|
|
||||||
public void rename(final String newName) {
|
public void rename(final String newName) {
|
||||||
name = newName;
|
name = newName;
|
||||||
File directory0 = new File(ForgeConstants.CONQUEST_SAVE_DIR, name.replace(' ', '_'));
|
File directory0 = new File(ForgeConstants.CONQUEST_SAVE_DIR, name.replace(' ', '_'));
|
||||||
|
|||||||
@@ -80,7 +80,29 @@ public class ConquestPlaneData implements IXmlWritable {
|
|||||||
return conquered;
|
return conquered;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUnlockedCount() {
|
public int getTotalWins() {
|
||||||
|
int wins = 0;
|
||||||
|
for (int i = 0; i < eventResults.length; i++) {
|
||||||
|
ConquestEventRecord result = eventResults[i];
|
||||||
|
if (result != null) {
|
||||||
|
wins += result.getTotalWins();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return wins;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalLosses() {
|
||||||
|
int losses = 0;
|
||||||
|
for (int i = 0; i < eventResults.length; i++) {
|
||||||
|
ConquestEventRecord result = eventResults[i];
|
||||||
|
if (result != null) {
|
||||||
|
losses += result.getTotalLosses();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return losses;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUnlockedCardCount() {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
ConquestData model = FModel.getConquest().getModel();
|
ConquestData model = FModel.getConquest().getModel();
|
||||||
for (PaperCard pc : location.getPlane().getCardPool().getAllCards()) {
|
for (PaperCard pc : location.getPlane().getCardPool().getAllCards()) {
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package forge.planarconquest;
|
||||||
|
|
||||||
|
import forge.interfaces.IButton;
|
||||||
|
|
||||||
|
public interface IVConquestStats {
|
||||||
|
IButton getLblAEtherShards();
|
||||||
|
IButton getLblPlaneswalkEmblems();
|
||||||
|
IButton getLblTotalWins();
|
||||||
|
IButton getLblTotalLosses();
|
||||||
|
IButton getLblConqueredEvents();
|
||||||
|
IButton getLblUnlockedCards();
|
||||||
|
IButton getLblCommanders();
|
||||||
|
IButton getLblPlaneswalkers();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user