home *** CD-ROM | disk | FTP | other *** search
- // point.cls a Point class. defines an x,y coordinate point
- //
- // x,y mapped: (like saying x=row, y=col)
- //
- // 0,0 +---------- y ->
- // |
- // |
- // x
- // |
- //
- // (c) Aspen Scientific 1989. All Rights Reserved.
- // Author: Vaughn Vernon
-
- #ifndef _POINT_CLASS
-
- # define _POINT_CLASS 1
-
- // Point class
-
- class Point {
- int xc, yc;
- public:
- int x() { return xc; }
- int y() { return yc; }
- int x(int xx) { return (xc = xx); }
- int y(int yy) { return (yc = yy); }
-
- Point & operator=(Point & p) { xc = p.xc; yc = p.yc; return *this; }
- Point & operator()(int xx, int yy) { xc = xx; yc = yy; return *this; }
- int operator==(Point & p) { return (xc == p.xc && yc == p.yc); }
- virtual void draw() { }
-
- Point(int xx =0, int yy =0) { xc=xx; yc=yy; }
- ~Point() { }
- };
-
- #endif
-