diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2023-02-19 12:47:44 +0100 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2023-02-19 12:47:44 +0100 |
| commit | 99f7e18c12945e9fbe22524a84a85e5733898dd2 (patch) | |
| tree | 9915227803f007bd4886ce2e997959e4cd30516c /game.py | |
| parent | af087e34e7a60e75db349aa9b3bb671b2aa70bfc (diff) | |
refactor: Split files
Diffstat (limited to 'game.py')
| -rw-r--r-- | game.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -0,0 +1,14 @@ +from dataclasses import dataclass +from datetime import datetime + +from player import Player + + +@dataclass(frozen=True) +class Game: + played_at: datetime + scores: dict[Player, int] + + def __str__(self) -> str: + total_points = sum(self.scores.values()) + return f"Game played at {self.played_at} ({total_points} total points)" |
