summaryrefslogtreecommitdiff
path: root/scripts/cards/card.js
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2021-10-19 00:18:37 -0400
committerKyle Gunger <kgunger12@gmail.com>2021-10-19 00:18:37 -0400
commit811571e23b68f4318794de3d34aa15cb91ec3d2d (patch)
tree56c1a5648a06aac8c59125d0af7669c0a9688547 /scripts/cards/card.js
parentfb231e3c6f3afbd40de5a94187221b788656cb5c (diff)
[Refactor] Lots of little patches
+ Make chatbox code a little cleaner + Add a bit of documentation + Begin prep for passwords + Function to easily grab decks from cards ~ I am going to have to completely re-do cards and decks probably.
Diffstat (limited to 'scripts/cards/card.js')
-rw-r--r--scripts/cards/card.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/cards/card.js b/scripts/cards/card.js
index 43dc965..47c7f17 100644
--- a/scripts/cards/card.js
+++ b/scripts/cards/card.js
@@ -7,16 +7,12 @@ const CardPos = ["top", "topl", "topr", "mid", "midt", "midb", "bot", "botl", "b
// Every card should have a deck.
// Use deck.appendCard or deck.prependCard to make a card visible
class Card {
- constructor (id, data)
+ constructor (data)
{
this.e = document.createElement("card");
this.generateElements(data);
this.e.style.left = "0px";
this.e.style.top = "0px";
-
- this.getID = function() {
- return id;
- }
}
// Generate a card with basic text only
@@ -117,4 +113,8 @@ class Card {
this.e.style.left = "0px";
this.e.style.top = "0px";
}
+
+ getDeck() {
+ return this.e.parentElement.deck;
+ }
}