You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Utility.showMessage("There is no card with this name in collection cards :(");
68
-
return;
66
+
AlertController.setAndShowAndGetResultByAnAlertController("There is no card with this name in collection cards", false);
67
+
returnfalse;
69
68
}
69
+
//todo
70
70
Cardcard = Card.getAllCards().get(cardID);
71
71
if (cardinstanceofHero) {
72
72
if (deck.getHero() != null) {
73
-
Utility.showMessage("There is already a hero in this deck. You can't add any other");
74
-
return;
73
+
AlertController.setAndShowAndGetResultByAnAlertController("There is already a hero in this deck. You can't add any other", false);
74
+
returnfalse;
75
75
} else {
76
76
deck.setHero((Hero) card);
77
-
Utility.showMessage("Card added to deck successfully :)");
78
-
return;
77
+
AlertController.setAndShowAndGetResultByAnAlertController("Card added to deck successfully", false);
78
+
returntrue;
79
79
}
80
80
}
81
81
if (Spell.checkIsItem(card)) {
82
82
if (deck.getItem() != null) {
83
-
Utility.showMessage("There is an item in this deck");
84
-
return;
83
+
AlertController.setAndShowAndGetResultByAnAlertController("There is an item in this deck", false);
84
+
returnfalse;
85
85
} else {
86
86
deck.setItem((Spell) card);
87
-
Utility.showMessage("Card added to deck successfully :)");
88
-
return;
87
+
AlertController.setAndShowAndGetResultByAnAlertController("Card added to deck successfully", false);
88
+
returntrue;
89
89
}
90
90
}
91
91
if (deck.getCardIDs().size() == 20) {
92
-
Utility.showMessage("You have 20 cards in your deck. You couldn't put any other card");
93
-
return;
92
+
AlertController.setAndShowAndGetResultByAnAlertController("You have 20 cards in your deck. You couldn't put any other card", false);
93
+
returnfalse;
94
94
}
95
+
//todo
95
96
intnumberOfCard = 0;
96
97
for (intID : deck.getCardIDs()) {
97
98
if (ID == cardID) {
98
99
numberOfCard++;
99
100
}
100
101
}
101
102
if (numberOfCard >= Collection.getCollection().howManyCard.get(cardName)) {
102
-
Utility.showMessage("You can't add this card to your deck. You haven't enough number of it in your collection");
103
-
return;
103
+
AlertController.setAndShowAndGetResultByAnAlertController("You can't add this card to your deck. You haven't enough number of it in your collection", false);
104
+
returnfalse;
104
105
}
106
+
//todo
105
107
deck.getCardIDs().add(cardID);
106
108
if (cardinstanceofWarrior) {
107
109
deck.minions.add(card);
108
110
} else {
109
111
deck.spells.add(card);
110
112
}
111
-
Utility.showMessage("Card added to deck successfully :)");
113
+
AlertController.setAndShowAndGetResultByAnAlertController("Card added to deck successfully", false);
0 commit comments