Convert TOTs to datetime.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
This commit is contained in:
Dan Albert
2022-09-02 20:58:26 -07:00
parent ac6cc39616
commit fd2ba6b2b2
51 changed files with 293 additions and 273 deletions

View File

@@ -34,11 +34,18 @@ class SimController(QObject):
return self.game_loop.completed
@property
def current_time_in_sim(self) -> Optional[datetime]:
def current_time_in_sim_if_game_loaded(self) -> datetime | None:
if self.game_loop is None:
return None
return self.game_loop.current_time_in_sim
@property
def current_time_in_sim(self) -> datetime:
time = self.current_time_in_sim_if_game_loaded
if time is None:
raise RuntimeError("No game is loaded")
return time
@property
def elapsed_time(self) -> timedelta:
if self.game_loop is None: