Esempio n. 1
0
 def _set_expected_time(self, target_hours, target_minutes, days_ahead):
     clock = services.game_clock_service()
     self._current_date_and_time = clock.now()
     clock_days = int(self._current_date_and_time.absolute_days())
     time_span = self._current_date_and_time - DateAndTime(interval_in_sim_days(clock_days).in_ticks())
     current_date_and_time_minus_days = DateAndTime(time_span.in_ticks())
     clock_hours = int(current_date_and_time_minus_days.absolute_hours())
     time_span = current_date_and_time_minus_days - DateAndTime(interval_in_sim_hours(clock_hours).in_ticks())
     current_date_and_time_minus_hours = DateAndTime(time_span.in_ticks())
     clock_minutes = int(current_date_and_time_minus_hours.absolute_minutes())
     delta_days = days_ahead
     clock_day_minutes = clock_hours*60 + clock_minutes
     target_day_minutes = target_hours*60 + target_minutes
     delta_day_minutes = target_day_minutes - clock_day_minutes
     if delta_day_minutes < 0:
         delta_day_minutes += 1440
     self._expected_data_and_time = self._current_date_and_time + interval_in_sim_days(delta_days) + interval_in_sim_minutes(delta_day_minutes)
Esempio n. 2
0
 def get_hours_worked(self):
     date_and_time = DateAndTime(self._time_worked)
     return date_and_time.absolute_hours()
 def get_hours_worked(self):
     date_and_time = DateAndTime(self._time_worked)
     return date_and_time.absolute_hours()