AdventOfCode/AdventOfCode.Core/Shared/Grid/Point.cs
2023-12-09 09:18:10 +01:00

27 lines
653 B
C#

using static System.Collections.Specialized.BitVector32;
namespace AdventOfCode.Core.Shared.Grid
{
public class Point(long X, long Y)
{
public long X { get; set; } = X;
public long Y { get; set; } = Y;
public string Value { get; set; } = string.Empty;
public Point(long X, long Y, string value) : this(X, Y) => Value = value;
public bool Intersect(Point other)
{
if (other == null) return false;
return this.X == other.X && this.Y == other.Y;
}
public override string ToString()
{
return $"[{Y},{X}] {Value}";
}
}
}