mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Convert TOTs to datetime.
https://github.com/dcs-liberation/dcs_liberation/issues/1680
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user