utility Coordinate.cs
This commit is contained in:
16
AdventOfCode2025/Utils/Coordinate.cs
Normal file
16
AdventOfCode2025/Utils/Coordinate.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Numerics;
|
||||
|
||||
namespace AdventOfCode2025.Utils;
|
||||
|
||||
public record struct Coordinate(int X, int Y) : IAdditionOperators<Coordinate,Coordinate,Coordinate>, ISubtractionOperators<Coordinate,Coordinate,Coordinate>
|
||||
{
|
||||
public static Coordinate operator +(Coordinate left, Coordinate right)
|
||||
{
|
||||
return new Coordinate(left.X + right.X, left.Y + right.Y);
|
||||
}
|
||||
|
||||
public static Coordinate operator -(Coordinate left, Coordinate right)
|
||||
{
|
||||
return new Coordinate(left.X - right.X, left.Y - right.Y);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user