Commit 3c053b8d authored by fallenstardust's avatar fallenstardust

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

parent 0fb4878c
......@@ -103,18 +103,30 @@ public class DeckInfo {
}
public boolean addMainCards(Card card) {
return addMainCards(-1, card);
return addMainCards(-1, card, false);
}
public boolean addMainCards(int index, Card card) {
if (card != null && mainCount < Constants.DECK_MAIN_MAX) {
if (index >= 0 && index <= mainCards.size()) {
this.mainCards.add(index, card);
} else {
this.mainCards.add(card);
public boolean addMainCards(int index, Card card, boolean isPack) {
if (!isPack) {
if (card != null && mainCount < Constants.DECK_MAIN_MAX) {
if (index >= 0 && index <= mainCards.size()) {
this.mainCards.add(index, card);
} else {
this.mainCards.add(card);
}
mainCount++;
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;
}
mainCount++;
return true;
}
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