This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
Snakity/Snakity/Point.cs

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);
}
}