Esempio n. 1
0
 def on_debriefing_update(self, debriefing: Debriefing) -> None:
     try:
         logging.info("On Debriefing update")
         logging.debug(debriefing)
         DebriefingFileWrittenSignal.get_instance().sendDebriefing(debriefing)
     except Exception:
         logging.exception("Got an error while sending debriefing")
     self.wait_thread = wait_for_debriefing(
         lambda d: self.on_debriefing_update(d), self.game, self.unit_map
     )
    def process_debriefing(self):
        start = timeit.default_timer()
        self.game.finish_event(event=self.gameEvent,
                               debriefing=self.debriefing)
        self.game.pass_turn()

        GameUpdateSignal.get_instance().sendDebriefing(self.debriefing)
        GameUpdateSignal.get_instance().updateGame(self.game)
        end = timeit.default_timer()
        logging.info("Turn processing took %s", timedelta(seconds=end - start))
        self.close()
 def on_debriefing_udpate(self, debriefing):
     try:
         logging.info("On Debriefing update")
         print(debriefing)
         DebriefingFileWrittenSignal.get_instance().sendDebriefing(
             debriefing)
     except Exception as e:
         logging.error("Got an error while sending debriefing")
         logging.error(e)
     self.wait_thread = wait_for_debriefing(
         lambda debriefing: self.on_debriefing_udpate(debriefing),
         self.game)