def start(self): def reset_current_visible_pages(): VisiblePage.objects.all().delete() for page in Page.objects.filter(initially_visible=True): VisiblePage(page=page).save() if self.current_game.state != CurrentGame.RUN: if self.current_game.state != CurrentGame.PAUSE: self.current_game.start_datetime = now() reset_current_visible_pages() MapEvent.delete_everything() self.current_game.state = CurrentGame.RUN self.current_game.save()
def stop(self): self.current_game.state = CurrentGame.STOP self.current_game.save() MapEvent.delete_everything()