Skip to content

Commit 3099f58

Browse files
authored
Update objects.py
1 parent 2f3b69f commit 3099f58

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

brawlpy/objects.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import json
3+
from .icons import brawlers as br_icons
34

45
__location__ = os.path.realpath(
56
os.path.join(os.getcwd(), os.path.dirname(__file__)))
@@ -245,11 +246,8 @@ def __str__(self):
245246
return "{0.name} ({0.id})".format(self)
246247

247248
def get_icon_url(self):
248-
249-
with open(os.path.join(__location__, "brawler_icons.json")) as icons:
250-
data = json.load(icons)
251-
252-
return data[str(self.id)]
249+
250+
return br_icons[str(self.id)]
253251

254252
class PlayerBrawler:
255253

@@ -287,10 +285,7 @@ def __str__(self):
287285

288286
def get_icon_url(self):
289287

290-
with open(os.path.join(__location__, "brawler_icons.json")) as icons:
291-
data = json.load(icons)
292-
293-
return data[str(self.id)]
288+
return br_icons[str(self.id)]
294289

295290

296291
class Gadget:

0 commit comments

Comments
 (0)