eva_bead_1/model/Point.cs
2024-10-23 22:11:14 +02:00

19 lines
417 B
C#

using System.Numerics;
namespace Snake.Model;
// Struct to store a point. A bit functional looking
public readonly record struct Point{
public readonly int X;
public readonly int Y;
public Point(int x, int y){
X = x;
Y = y;
}
// This is where the magic happens
public static implicit operator Point((int x, int y) tuple){
return new Point(tuple.x, tuple.y);
}
}