The class is not completely compatible, since for methods like isBelow: and isAbove: we assume a coordinate system with the origin at lower-left (while the original screen-display oriented class assumed an upper-left origin.
+ newReturns the point (0,0).
Note: incompatible with ICpak101
Note: incompatible with ICpak101
x:y:
+ x :(int) x y :(int) y
Returns the point (x,y).
x:y:
- x :(int) x y :(int) y
Resets the coordinates of an existing point to (x,y).
x:
- x :(int) x
Resets the xLoc coordinate. Returns the receiver.
y:
- y :(int) y
Resets the yLoc coordinate. Returns the receiver.
x
- (int) x
Returns xLoc as int value.
y
- (int) y
Returns yLoc as int value.
hash
- (unsigned) hash
Returns a hash value based on the values of xLoc and yLoc.
isEqual:
- (BOOL) isEqual : aPoint
Returns YES if both arguments are instances of Point (or of a subclass of Point) and if they have the same coordinates.
isBelow:
- (BOOL) isBelow : aPoint
Returns YES if the receiver's y coordinate is greater than the y coordinate of aPoint.
isAbove:
- (BOOL) isAbove : aPoint
Returns YES if the receiver's y coordinate is less than the y coordinate of aPoint.
isLeft:
- (BOOL) isLeft : aPoint
Returns YES if the receiver's x coordinate is less than the x coordinate of aPoint.
isRight:
- (BOOL) isRight : aPoint
Returns YES if the receiver's x coordinate is greater than the x coordinate of aPoint.
moveBy:
- moveBy : aPoint
Adds coordinates of aPoint to the receiver. Unlike plus:, this method does not return a new object.
moveBy::
- moveBy :(int) x :(int) y
Adds x and y coordinates of aPoint to the receiver. Unlike plus:, this method does not return a new object.
moveTo:
- moveTo : aPoint
Copies the coordinates of aPoint into the receiver. Typically used for translation.
plus:
- plus : aPoint
This method is like moveBy: but it returns a new point instance.
printOn:
- printOn :(IOD) aFile
Prints x and y coordinates inside parenthesis.
fileOutOn:
- fileOutOn : aFiler
Writes the point on aFiler. Returns the receiver.
fileInFrom:
- fileInFrom : aFiler
Reads the point from aFiler. Returns the receiver.