Support for hybrid symbols in the database loader
This commit is contained in:
parent
436c635eb2
commit
4932e7c1fa
1 changed files with 3 additions and 8 deletions
11
database.py
11
database.py
|
@ -40,7 +40,7 @@ class TextDB(Database):
|
|||
}
|
||||
elif card and line:
|
||||
# Load the data into the card
|
||||
if not card['cost'] and re.match('^X?\d*[{0}]*$'.format(' '.join(Mana.types.keys())), line):
|
||||
if not card['cost'] and re.match('^X?\d*(\((\d+|[{0}])/(\d+|[{0}])\))*[{0}]*$'.format(''.join(Mana.types.keys())), line.upper()):
|
||||
card['cost'] = line
|
||||
continue
|
||||
elif not card['type']:
|
||||
|
@ -93,10 +93,5 @@ class WagicDB(Database):
|
|||
|
||||
if __name__ == '__main__':
|
||||
db = TextDB('db.txt')
|
||||
deck = Deck()
|
||||
deck.load('decks/BlackSiege.txt', db)
|
||||
|
||||
wagic = Deck()
|
||||
w = WagicDB('/home/correlr/Download/wth/PSP/GAME/WTH')
|
||||
for card in deck:
|
||||
wagic.append(w.getCard(card.name, card))
|
||||
c = db.getCard('Balefire Liege')
|
||||
print c
|
||||
|
|
Loading…
Reference in a new issue