point.h 498 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. struct Point
  3. {
  4. public:
  5. Point( int px = 0, int py = 0 );
  6. Point( const Point& other );
  7. void Offset( int xOffset, int yOffset );
  8. void Offset( const Point& point );
  9. Point& operator += ( const Point& other );
  10. Point& operator -= ( const Point& other );
  11. int x;
  12. int y;
  13. };
  14. Point operator + ( const Point& p1, const Point& p2 );
  15. Point operator - ( const Point& p1, const Point& p2 );
  16. bool operator == ( const Point& p1, const Point& p2 );