Skip to content

Commit

Permalink
Point2 * Facing operator
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddyThorson committed Jul 23, 2024
1 parent 2e69b21 commit 4f478a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Framework/Spatial/Point2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ public static Point2 FromBools(bool left, bool right, bool up, bool down)
public static Point2 operator +(Point2 a, Point2 b) => new(a.X + b.X, a.Y + b.Y);
public static Point2 operator -(Point2 a, Point2 b) => new(a.X - b.X, a.Y - b.Y);

public static Point2 operator *(Point2 point, Facing facing) => new(point.X * facing.Sign, point.Y);

public static Rect operator +(Point2 a, Rect b) => new(a.X + b.X, a.Y + b.Y, b.Width, b.Height);
public static Rect operator +(Rect a, Point2 b) => new(b.X + a.X, b.Y + a.Y, a.Width, a.Height);

Expand Down

0 comments on commit 4f478a7

Please sign in to comment.