Skip to content

Commit 71e00ca

Browse files
committed
Fix for run_games and text_runner reading from a deck file.
Fixes #98
1 parent 446aae6 commit 71e00ca

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

run_games.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
from hearthbreaker.agents.basic_agents import RandomAgent
3+
from hearthbreaker.cards.heroes import hero_for_class
34
from hearthbreaker.constants import CHARACTER_CLASS
45
from hearthbreaker.engine import Game, Deck, card_lookup
56
from hearthbreaker.cards import *
@@ -25,7 +26,7 @@ def load_deck(filename):
2526
if len(cards) > 30:
2627
pass
2728

28-
return Deck(cards, character_class)
29+
return Deck(cards, hero_for_class(character_class))
2930

3031

3132
def do_stuff():

text_runner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44

55
from hearthbreaker.agents import registry
6+
from hearthbreaker.cards.heroes import hero_for_class
67
from hearthbreaker.constants import CHARACTER_CLASS
78
from hearthbreaker.engine import Game, Deck, card_lookup
89
from hearthbreaker.ui.game_printer import GameRender
@@ -28,7 +29,7 @@ def load_deck(filename):
2829
if len(cards) > 30:
2930
pass
3031

31-
return Deck(cards, character_class)
32+
return Deck(cards, hero_for_class(character_class))
3233

3334

3435
def print_usage():

0 commit comments

Comments
 (0)