From 60f2b0e2e5aa7b53ea0a141bd970f52d83db5aae Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Sun, 16 Apr 2017 22:49:35 -0500 Subject: [PATCH] Add a pluck method --- cogs/utils/cards.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cogs/utils/cards.py b/cogs/utils/cards.py index 8a004d2..93ad05d 100644 --- a/cogs/utils/cards.py +++ b/cogs/utils/cards.py @@ -44,6 +44,10 @@ class Deck: """Adds the provided cards to the end of the deck""" self.deck.extend(cards) + def pluck(self, card): + """Pulls the provided card from the deck""" + return self.deck.pop(self.deck.index(card)) + def shuffle(self): """Shuffles the deck in place""" random.SystemRandom().shuffle(self.deck)