summaryrefslogtreecommitdiff
path: root/scripts/cards/deck.js
diff options
context:
space:
mode:
authorKyle Gunger <corechg@gmail.com>2020-09-29 01:53:49 -0400
committerKyle Gunger <corechg@gmail.com>2020-09-29 01:53:49 -0400
commit673d16d8f2fb9d7b7df5f6fcadfbc665f329887c (patch)
treea75381de6b9d2441310599de71fd7ea5d143b153 /scripts/cards/deck.js
parent04010b3b1f6ba6fc44d2cd0cd6a8a39446cd7b1d (diff)
More drag updates
Diffstat (limited to 'scripts/cards/deck.js')
-rw-r--r--scripts/cards/deck.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/cards/deck.js b/scripts/cards/deck.js
index 6da24b0..d87d619 100644
--- a/scripts/cards/deck.js
+++ b/scripts/cards/deck.js
@@ -13,7 +13,7 @@ class Deck {
y = 0;
e = null;
- constructor(options = {mode: "stack", smode: "one", sct: 0, pos: [0, 0]})
+ constructor(id, options = {mode: "stack", smode: "one", sct: 0, pos: [0, 0]})
{
// View mode
// infdraw - infinite draw. always appears as if there are multiple cards
@@ -54,6 +54,10 @@ class Deck {
this.e.style.left = this.x + "px";
this.e.style.top = this.y + "px";
this.e.setAttribute("mode", options.mode);
+
+ this.getID = function() {
+ return id;
+ }
}
updatePos()
@@ -143,4 +147,14 @@ class Deck {
var rect = this.e.getBoundingClientRect();
return (x > rect.left && x < rect.right && y > rect.top && y < rect.bottom)
}
+
+ checkCard (el)
+ {
+ for(let c of this.cards)
+ {
+ if(c.e === el)
+ return c;
+ }
+ return null;
+ }
}