diff --git a/erynrl/geometry.py b/erynrl/geometry.py index acb1584..050222f 100644 --- a/erynrl/geometry.py +++ b/erynrl/geometry.py @@ -163,11 +163,18 @@ class Size: @dataclass class Rect: - '''A two-dimensional rectangle, defined by an origin point and size''' + ''' + A two-dimensional rectangle defined by an origin point and size + ''' origin: Point size: Size + @staticmethod + def from_raw_values(x: int, y: int, width: int, height: int): + '''Create a rect from raw (unpacked from their struct) values''' + return Rect(Point(x, y), Size(width, height)) + @property def min_x(self) -> int: '''Minimum x-value that is still within the bounds of this rectangle. This is the origin's x-value.'''