summaryrefslogtreecommitdiff
path: root/scripts/cards/deck.js
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-07-17 20:40:58 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-07-17 20:40:58 -0400
commit4b408bf19a1ad8ab73626c333245157e71158b2e (patch)
tree64da2d704813c7024fe592c45dc06383e593620e /scripts/cards/deck.js
parentf6735c5864593c4ffeace9f1877aee3d64326549 (diff)
Fix table getting cards
Diffstat (limited to 'scripts/cards/deck.js')
-rw-r--r--scripts/cards/deck.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/cards/deck.js b/scripts/cards/deck.js
index 941df8c..0c88821 100644
--- a/scripts/cards/deck.js
+++ b/scripts/cards/deck.js
@@ -70,17 +70,25 @@ class Deck {
appendCard(card)
{
+ if(this.inf) {
+ return false;
+ }
this.cards.push(card);
this.e.appendChild(card.e);
this.updatePos();
+ return true;
}
prependCard(card)
{
+ if(this.inf) {
+ return false;
+ }
this.cards.unshift(card);
this.e.prepend(card.e);
card.setPos(this.cards.length - 1);
this.updateCount();
+ return true;
}
addCardAt(card, index)