mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add __str__ for Distance.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user