Skip to content

Commit

Permalink
Holt's recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
Silarn committed Sep 19, 2023
1 parent 6db3411 commit a846216
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions games/game_bladeandsorcery.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ class BaSSaveGame(BasicGameSaveGame):
def __init__(self, filepath):
super().__init__(filepath)
self._filepath = Path(filepath)
save = open(self._filepath, "rb")
save_data = json.load(save)
with open(self._filepath, "rb") as save:
save_data = json.load(save)
self._gameMode: str = save_data["gameModeId"]
self._gender: str = "Male" if save_data["creatureId"] == "PlayerDefaultMale" else "Female"
self._gender = "Male" if save_data["creatureId"] == "PlayerDefaultMale" else "Female"
self._ethnicity: str = save_data["ethnicGroupId"]
h, m, s = save_data["playTime"].split(":")
self._elapsed: tuple[int, int, float] = (int(h), int(m), float(s))
self._created: float = os.path.getctime(filepath)
self._modified: float = os.path.getmtime(filepath)
save.close()
self._elapsed = (int(h), int(m), float(s))
f_stat = self._filepath.stat()
self._created = f_stat.st_ctime
self._modified = f_stat.st_mtime

def getName(self) -> str:
return f"{self.getPlayerSlug()} - {self._gameMode}"
Expand Down

0 comments on commit a846216

Please sign in to comment.