Skip to content

Commit

Permalink
Add __str__ for Heading.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanAlbert committed Jul 30, 2023
1 parent d45cc04 commit a489a54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions game/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ def __add__(self, other: Heading) -> Heading:
def __sub__(self, other: Heading) -> Heading:
return Heading.from_degrees(self.degrees - other.degrees)

def __str__(self) -> str:
return f"{self.heading_in_degrees}°"


@dataclass(frozen=True, order=True)
class Pressure:
Expand Down

0 comments on commit a489a54

Please sign in to comment.