point.h 528 B

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