Redraw flight plans when they change.

This commit is contained in:
Dan Albert
2020-09-27 18:35:16 -07:00
parent 1e041b6249
commit aa309af015
5 changed files with 56 additions and 10 deletions

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
from PySide2.QtCore import QObject, Signal
from game import Game
@@ -19,21 +21,31 @@ class GameUpdateSignal(QObject):
budgetupdated = Signal(Game)
debriefingReceived = Signal(DebriefingSignal)
flight_paths_changed = Signal()
def __init__(self):
super(GameUpdateSignal, self).__init__()
GameUpdateSignal.instance = self
def redraw_flight_paths(self) -> None:
# noinspection PyUnresolvedReferences
self.flight_paths_changed.emit()
def updateGame(self, game: Game):
# noinspection PyUnresolvedReferences
self.gameupdated.emit(game)
def updateBudget(self, game: Game):
# noinspection PyUnresolvedReferences
self.budgetupdated.emit(game)
def sendDebriefing(self, game: Game, gameEvent: Event, debriefing: Debriefing):
sig = DebriefingSignal(game, gameEvent, debriefing)
# noinspection PyUnresolvedReferences
self.gameupdated.emit(game)
# noinspection PyUnresolvedReferences
self.debriefingReceived.emit(sig)
@staticmethod
def get_instance():
def get_instance() -> GameUpdateSignal:
return GameUpdateSignal.instance