Add StatsManager for single display

This commit is contained in:
thePR0M3TH3AN
2025-07-31 16:01:40 -04:00
parent a4ddd120c8
commit 6d82ef1815
5 changed files with 76 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
"""Manage display of stats screens."""
from __future__ import annotations
class StatsManager:
"""Track whether stats have been displayed."""
def __init__(self) -> None:
self._displayed = False
def display_stats_once(self, manager) -> None:
"""Display stats using ``manager`` once per reset."""
if not self._displayed:
manager.display_stats()
self._displayed = True
def reset(self) -> None:
"""Reset the displayed flag."""
self._displayed = False