From 8a08b97c7b714c119f25c68267826a9aba369715 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Thu, 17 Jun 2010 11:02:05 -0400 Subject: [PATCH] Card multiplication! Useful? Who knows! --- mtg.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mtg.py b/mtg.py index 8caff24..8c9a667 100644 --- a/mtg.py +++ b/mtg.py @@ -141,6 +141,11 @@ class Card: self.store() def __repr__(self): return 'Card: [{2}] {0}: {1} [{3}/{4}]'.format(self.name, ' '.join([a.capitalize() for a in self.attributes]), self.cost, self.power, self.toughness) + def __mul__(self, other): + result = [] + for i in xrange(other): + result.append(copy.copy(self)) + return result def store(self): self.__stored = copy.copy(self) def restore(self):