Commit 3c053b8d authored by fallenstardust's avatar fallenstardust

当为pack类型的deckinfo时,添加主卡数量解除60张上限

parent 0fb4878c
...@@ -103,10 +103,11 @@ public class DeckInfo { ...@@ -103,10 +103,11 @@ public class DeckInfo {
} }
public boolean addMainCards(Card card) { public boolean addMainCards(Card card) {
return addMainCards(-1, card); return addMainCards(-1, card, false);
} }
public boolean addMainCards(int index, Card card) { public boolean addMainCards(int index, Card card, boolean isPack) {
if (!isPack) {
if (card != null && mainCount < Constants.DECK_MAIN_MAX) { if (card != null && mainCount < Constants.DECK_MAIN_MAX) {
if (index >= 0 && index <= mainCards.size()) { if (index >= 0 && index <= mainCards.size()) {
this.mainCards.add(index, card); this.mainCards.add(index, card);
...@@ -116,6 +117,17 @@ public class DeckInfo { ...@@ -116,6 +117,17 @@ public class DeckInfo {
mainCount++; mainCount++;
return true; return true;
} }
} else {
if (card != null) {
if (index >= 0 && index <= mainCards.size()) {
this.mainCards.add(index, card);
} else {
this.mainCards.add(card);
}
mainCount++;
return true;
}
}
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment