beginning implementations of CardCollection and some of its subclasses

This commit is contained in:
2020-03-17 22:43:03 -04:00
parent 2e676e4708
commit c1120bcd93
7 changed files with 57 additions and 1 deletions

25
BearOnline/cards/_card.py Normal file
View File

@@ -0,0 +1,25 @@
import abc
from abc import ABC
from functools import total_ordering
@total_ordering
class Card(ABC):
def __init__(self, rank, suit):
self._rank = rank
self._suit = suit
@abc.abstractmethod
def __lt__(self, other):
pass
@abc.abstractmethod
def __eq__(self, other):
pass
@property
def rank(self):
return self._rank
@property
def suit(self):
return self._suit