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:
|
elif card and line:
|
||||||
# Load the data into the card
|
# 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
|
card['cost'] = line
|
||||||
continue
|
continue
|
||||||
elif not card['type']:
|
elif not card['type']:
|
||||||
|
@ -93,10 +93,5 @@ class WagicDB(Database):
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
db = TextDB('db.txt')
|
db = TextDB('db.txt')
|
||||||
deck = Deck()
|
c = db.getCard('Balefire Liege')
|
||||||
deck.load('decks/BlackSiege.txt', db)
|
print c
|
||||||
|
|
||||||
wagic = Deck()
|
|
||||||
w = WagicDB('/home/correlr/Download/wth/PSP/GAME/WTH')
|
|
||||||
for card in deck:
|
|
||||||
wagic.append(w.getCard(card.name, card))
|
|
||||||
|
|
Loading…
Reference in a new issue