#include "point.h" Point::Point( int px, int py ) : x( px ), y( py ) { } Point::Point( const Point& other ) : x( other.x ), y( other.y ) { } void Point::Offset( int xOffset, int yOffset ) { x += xOffset; y += yOffset; } void Point::Offset( const Point& point ) { x += point.x; y += point.y; } Point& Point::operator += ( const Point& other ) { x += other.x; y += other.y; return *this; } Point& Point::operator -= ( const Point& other ) { x -= other.x; y -= other.y; return *this; } Point operator + ( const Point& p1, const Point& p2 ) { return Point( p1.x + p2.x, p1.y + p2.y ); } Point operator - ( const Point& p1, const Point& p2 ) { return Point( p1.x - p2.x, p1.y - p2.y ); } bool operator == ( const Point& p1, const Point& p2 ) { return ( ( p1.x == p2.x ) && ( p1.y == p2.y ) ); }