From a7bff0985506b7e82c2dacf81c66900540ebdbe6 Mon Sep 17 00:00:00 2001 From: Dakota Date: Tue, 23 Jul 2024 17:58:59 +0200 Subject: [PATCH] fix: type checking vortex --- pyZUnivers/overview.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyZUnivers/overview.py b/pyZUnivers/overview.py index 8611a93..54d7d9f 100644 --- a/pyZUnivers/overview.py +++ b/pyZUnivers/overview.py @@ -42,28 +42,28 @@ def invocations_before_pity(self) -> int: @property def vortex_name(self) -> str: - if self.__vortex_stats == Vortex: + if isinstance(self.__vortex_stats, Vortex): return self.__vortex_stats.name return self.__vortex_stats['towerName'] @property def vortex_begin_date(self) -> datetime: - if self.__vortex_stats == Vortex: + if isinstance(self.__vortex_stats, Vortex): return self.__vortex_stats.begin_date return datetime.strptime(self.__vortex_stats['towerSeasonBeginDate'], DATE_FORMAT) @property def vortex_end_date(self) -> datetime: - if self.__vortex_stats == Vortex: + if isinstance(self.__vortex_stats, Vortex): return self.__vortex_stats.end_date return datetime.strptime(self.__vortex_stats['towerSeasonEndDate'], DATE_FORMAT) @property def vortex_floor(self) -> int: - if self.__vortex_stats == Vortex or not self.__vortex_stats['maxFloorIndex']: + if isinstance(self.__vortex_stats, Vortex) or not self.__vortex_stats['maxFloorIndex']: return 0 if self.__vortex_stats['maxFloorIndex'] == 0: @@ -73,7 +73,7 @@ def vortex_floor(self) -> int: @property def vortex_tries(self) -> int: - if self.__vortex_stats == Vortex: + if isinstance(self.__vortex_stats, Vortex): return 0 return self.__vortex_stats['towerLogCount'] \ No newline at end of file