diff options
Diffstat (limited to 'swiftstory/cards.py')
-rw-r--r-- | swiftstory/cards.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/swiftstory/cards.py b/swiftstory/cards.py new file mode 100644 index 0000000..d570f87 --- /dev/null +++ b/swiftstory/cards.py @@ -0,0 +1,16 @@ +import json + + +class Cards: + @staticmethod + def get_white_cards(lang): + ''' Read the file containing the white cards and return a list of cards ''' + with open(f'usr/share/swiftstory/lang/{lang}/cards/white.json', encoding='utf-8') as fh: + return json.load(fh) + + @staticmethod + def get_black_cards(lang): + ''' Read the file containing the black cards and return a list of cards ''' + + with open(f'usr/share/swiftstory/lang/{lang}/cards/black.json', encoding='utf-8') as fh: + return json.load(fh) |