]> git.armaanb.net Git - lightcards.git/blobdiff - lightcards/deck.py
Make percent complete end at 100%
[lightcards.git] / lightcards / deck.py
index 2a612027ad00d5d7c61fc3b02d9c7d22e14e4b6d..110c5b4fdcee15ab50a27c5eca2ea52dfa3a0ee7 100644 (file)
@@ -2,13 +2,21 @@
 # Armaan Bhojwani 2021
 
 
-class Card(list):
-    """Card extends the list class, and adds ability to star them."""
+class Card:
+    """Class containing the card information."""
 
     def __init__(self, inp):
-        super().__init__(inp)
         self.starred = False
         self.side = 0
+        self.front = ""
+        self.back = ""
+        if len(inp) >= 1:
+            self.front = inp[0]
+        if len(inp) >= 2:
+            self.back = inp[1]
+
+    def __str__(self):
+        return f"{self.front}, {self.back}"
 
     def unStar(self):
         self.starred = False
@@ -37,6 +45,15 @@ class Card(list):
     def getSide(self):
         return self.side
 
+    def get(self):
+        if self.side == 0:
+            return self.front
+        else:
+            return self.back
+
+    def getFront(self):
+        return self.front
+
     def flip(self):
         if self.side == 0:
             self.side = 1
@@ -45,13 +62,13 @@ class Card(list):
 
 
 class Status:
-    """The status class keeps track of where in the deck the user is"""
+    """Keeps track of where in the deck the user is"""
 
     def __init__(self):
         self.index = 0
 
     def forward(self, stack):
-        if not self.index == len(stack):
+        if self.index != len(stack):
             self.index += 1
 
     def back(self):