//I place this code in the public domain - Jamin Grey
struct Point
{
public:
int x;
int y;
public:
Point() : x(0), y(0) { }
Point(int x, int y) : x(x), y(y) { }
Point(const Point &point); //Copy constructor
~Point() = default;
/*
//Keeps the point within 'rect'.
void KeepWithin(const Rect &rect);
//Keeps the point outside of 'rect'.
void KeepWithout(const Rect &rect);
//Snaps the point to the nearest edge of 'rect', regardless of
//whether the point is inside or outside the rectangle.
void SnapToEdge(const Rect &rect);
*/
//Returns the absolute distance between this point and 'other'.
unsigned DistanceFrom(const Point &other);
//Returns true if we are within 'distance' of 'other'. This is faster than 'DistanceFrom', because it saves a sqrt().
bool WithinDistanceOf(const Point &other, unsigned distance) const;
bool operator==(const Point &other) const;
bool operator!=(const Point &other) const;
Point &operator=(const Point &other); //Assignment operator
Point &operator+=(const Point &other);
Point &operator-=(const Point &other);
Point &operator*=(const Point &other);
Point &operator/=(const Point &other);
Point &operator%=(const Point &other);
Point operator+(const Point &other) const;
Point operator-(const Point &other) const;
Point operator*(const Point &other) const;
Point operator/(const Point &other) const;
Point operator%(const Point &other) const;
//Additive-inverse operator.
Point operator-() const;
};