beginning implementations of CardCollection and some of its subclasses
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
from collections import deque
|
||||
|
||||
from .. import Card
|
||||
|
||||
class CardCollection(deque):
|
||||
def __init__(self, iterable, maxlen=None):
|
||||
if not len(iterable) == 0 or all([isinstance(Card, item) for item in iterable]):
|
||||
raise TypeError("CardCollections must only contain Cards")
|
||||
else:
|
||||
super().__init__(iterable, maxlen)
|
||||
Reference in New Issue
Block a user