19 lines
641 B
C#
19 lines
641 B
C#
namespace Snakity
|
|
{
|
|
public struct Point
|
|
{
|
|
public int X;
|
|
public int Y;
|
|
|
|
public Point(int x, int y)
|
|
{
|
|
X = x;
|
|
Y = y;
|
|
}
|
|
|
|
public static bool operator ==(Point left, Point right) => left.X == right.X && left.Y == right.Y;
|
|
public static bool operator !=(Point left, Point right) => left.X != right.X || left.Y != right.Y;
|
|
public static Point operator +(Point left, Point right) => new Point(left.X + right.X, left.Y + right.Y);
|
|
public static Point operator -(Point left, Point right) => new Point(left.X - right.X, left.Y - right.Y);
|
|
}
|
|
} |