mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Add __str__ for Distance.
This commit is contained in:
parent
42fa5dce94
commit
13ccf3f536
@ -201,6 +201,9 @@ class Distance:
|
||||
def inf(cls) -> Distance:
|
||||
return cls.from_meters(math.inf)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.distance_in_meters} meters"
|
||||
|
||||
def __add__(self, other: Distance) -> Distance:
|
||||
return meters(self.meters + other.meters)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user