mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Add commander and his deck to collection when commander added to your arsenal
This commit is contained in:
@@ -270,7 +270,7 @@ public class LoadConquestScreen extends FScreen {
|
|||||||
float iconSize = h + Utils.scale(1);
|
float iconSize = h + Utils.scale(1);
|
||||||
float iconOffset = SettingsScreen.SETTING_PADDING - Utils.scale(2);
|
float iconOffset = SettingsScreen.SETTING_PADDING - Utils.scale(2);
|
||||||
|
|
||||||
String cards = String.valueOf(value.getCardPool().countAll());
|
String cards = String.valueOf(value.getCollection().countAll());
|
||||||
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;
|
||||||
g.drawImage(FSkinImage.HAND, x + w - cardsWidth + iconOffset, y - SettingsScreen.SETTING_PADDING, iconSize, iconSize);
|
g.drawImage(FSkinImage.HAND, x + w - cardsWidth + iconOffset, y - SettingsScreen.SETTING_PADDING, iconSize, iconSize);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class ConquestController {
|
|||||||
|
|
||||||
public void load(final ConquestData model0) {
|
public void load(final ConquestData model0) {
|
||||||
model = model0;
|
model = model0;
|
||||||
cardPool = model == null ? null : model.getCardPool();
|
cardPool = model == null ? null : model.getCollection();
|
||||||
decks = model == null ? null : model.getDeckStorage();
|
decks = model == null ? null : model.getDeckStorage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public final class ConquestData {
|
|||||||
private ConquestPlane startingPlane, currentPlane;
|
private ConquestPlane startingPlane, currentPlane;
|
||||||
private List<ConquestCommander> commanders = new ArrayList<ConquestCommander>();
|
private List<ConquestCommander> commanders = new ArrayList<ConquestCommander>();
|
||||||
|
|
||||||
private final CardPool cardPool = new CardPool();
|
private final CardPool collection = new CardPool();
|
||||||
private final HashMap<String, Deck> decks = new HashMap<String, Deck>();
|
private final HashMap<String, Deck> decks = new HashMap<String, Deck>();
|
||||||
|
|
||||||
public ConquestData() { //needed for XML serialization
|
public ConquestData() { //needed for XML serialization
|
||||||
@@ -62,6 +62,8 @@ public final class ConquestData {
|
|||||||
ConquestCommander commander = new ConquestCommander(card, currentPlane.getCardPool());
|
ConquestCommander commander = new ConquestCommander(card, currentPlane.getCardPool());
|
||||||
commanders.add(commander);
|
commanders.add(commander);
|
||||||
decks.put(commander.getDeck().getName(), commander.getDeck());
|
decks.put(commander.getDeck().getName(), commander.getDeck());
|
||||||
|
collection.addAll(commander.getDeck().getMain());
|
||||||
|
collection.add(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@@ -80,8 +82,8 @@ public final class ConquestData {
|
|||||||
return currentPlane;
|
return currentPlane;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CardPool getCardPool() {
|
public CardPool getCollection() {
|
||||||
return cardPool;
|
return collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConquestDeckMap getDeckStorage() {
|
public ConquestDeckMap getDeckStorage() {
|
||||||
|
|||||||
Reference in New Issue
Block a user