Minor cleanup of notification system.

This commit is contained in:
Dan Albert
2021-09-05 21:14:18 -07:00
parent 12ad4fbf63
commit 18336f58d3
3 changed files with 18 additions and 48 deletions

View File

@@ -105,8 +105,8 @@ class Game:
self.game_stats = GameStats()
self.notes = ""
self.ground_planners: dict[int, GroundPlanner] = {}
self.informations = []
self.informations.append(Information("Game Start", "-" * 40, 0))
self.informations: list[Information] = []
self.message("Game Start", "-" * 40)
# Culling Zones are for areas around points of interest that contain things we may not wish to cull.
self.__culling_zones: List[Point] = []
self.__destroyed_units: list[dict[str, Union[float, str]]] = []
@@ -269,9 +269,7 @@ class Game:
Args:
skipped: True if the turn was skipped.
"""
self.informations.append(
Information("End of turn #" + str(self.turn), "-" * 40, 0)
)
self.message("End of turn #" + str(self.turn), "-" * 40)
self.turn += 1
# The coalition-specific turn finalization *must* happen before unit deliveries,
@@ -404,8 +402,8 @@ class Game:
gplanner.plan_groundwar()
self.ground_planners[cp.id] = gplanner
def message(self, text: str) -> None:
self.informations.append(Information(text, turn=self.turn))
def message(self, title: str, text: str = "") -> None:
self.informations.append(Information(title, text, turn=self.turn))
@property
def current_turn_time_of_day(self) -> TimeOfDay: