|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.Point
Represents an (x, y) point in a map.
Field Summary | |
int |
x
|
int |
y
|
Constructor Summary | |
Point()
Constructs a new Point |
|
Point(int x,
int y)
Constructs a new Point |
|
Point(Point p)
Constructs a new Point by copying the coordinates from an existing Point. |
|
Point(java.awt.Point p)
Constructs a new Point by copying the coordinates from an existing java.awt.Point. |
|
Point(Point p,
Point offset)
Constructs a new Point by copying the coordinates from an existing POint, and then adding the offsets stored in another Point. |
Method Summary | |
static int |
comparePoints(Point a,
Point b)
Utility: compares the points to see which one is less (by the game standards: first check Y, then X). |
boolean |
equals(int x,
int y)
Returns true if this Point equals another coordinate pair. |
boolean |
equals(java.lang.Object obj)
Returns true if this Point equals another one. |
static Point |
get(int x,
int y)
Shorthand for PointCache.getPoint ( x, y ) |
int |
getX()
Returns X coordinate. |
int |
getY()
Returns Y coordinate. |
int |
hashCode()
Returns a hashcode for this point. |
void |
setValues(Point p)
Sets values to those of the passed Point. |
void |
setX(int x)
Sets X coordinate. |
void |
setY(int y)
Sets Y coordinate. |
java.lang.String |
toString()
Formats the (x, y) coordinates. |
void |
translate(int x,
int y)
Translates the point by the given offets. |
void |
translate(Point offset)
Translates the point by the given offets. |
int |
x()
Returns X coordinate. |
int |
y()
Returns Y coordinate. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public int x
public int y
Constructor Detail |
public Point()
public Point(int x, int y)
public Point(Point p)
public Point(Point p, Point offset)
p
- the Point with the starting (x, y)offset
- a Point containing values to add to p's x and ypublic Point(java.awt.Point p)
Method Detail |
public static Point get(int x, int y)
public int getX()
public int getY()
public int x()
public int y()
public void setX(int x)
x
- new x coordinatepublic void setY(int y)
y
- new Y coordinatepublic void setValues(Point p)
public java.lang.String toString()
public void translate(int x, int y)
public void translate(Point offset)
offset
- the (x, y) offsets by which to translate this Pointpublic int hashCode()
public boolean equals(java.lang.Object obj)
public final boolean equals(int x, int y)
x
- x to comparey
- y to compare
public static int comparePoints(Point a, Point b)
a
- first pointb
- second point
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |