Add commander and his deck to collection when commander added to your arsenal

This commit is contained in:
drdev
2014-11-23 05:39:35 +00:00
parent aeea51cb28
commit 2e5202e9f1
3 changed files with 7 additions and 5 deletions

View File

@@ -270,7 +270,7 @@ public class LoadConquestScreen extends FScreen {
float iconSize = h + Utils.scale(1);
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);
float cardsWidth = font.getBounds(cards).width + iconSize + SettingsScreen.SETTING_PADDING;
g.drawImage(FSkinImage.HAND, x + w - cardsWidth + iconOffset, y - SettingsScreen.SETTING_PADDING, iconSize, iconSize);

View File

@@ -50,7 +50,7 @@ public class ConquestController {
public void load(final ConquestData model0) {
model = model0;
cardPool = model == null ? null : model.getCardPool();
cardPool = model == null ? null : model.getCollection();
decks = model == null ? null : model.getDeckStorage();
}

View File

@@ -44,7 +44,7 @@ public final class ConquestData {
private ConquestPlane startingPlane, currentPlane;
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>();
public ConquestData() { //needed for XML serialization
@@ -62,6 +62,8 @@ public final class ConquestData {
ConquestCommander commander = new ConquestCommander(card, currentPlane.getCardPool());
commanders.add(commander);
decks.put(commander.getDeck().getName(), commander.getDeck());
collection.addAll(commander.getDeck().getMain());
collection.add(card);
}
public String getName() {
@@ -80,8 +82,8 @@ public final class ConquestData {
return currentPlane;
}
public CardPool getCardPool() {
return cardPool;
public CardPool getCollection() {
return collection;
}
public ConquestDeckMap getDeckStorage() {