Files
Bear-Online/BearOnline/cards/card.py
Brennen Raimer 2e676e4708 implemented abstract Card class
implemented concrete PlayingCard class
2020-03-16 22:27:59 -04:00

26 lines
450 B
Python

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