|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.smtose.shadowedhorizons.world.Position
Provides a cartesian style positioning system.
The Position class is
copyright© 2005 smtose.org
(www.smtose.org)
| Constructor Summary | |
Position()
Constructs a Position object with coordinates (0,0). |
|
Position(int x,
int y)
Constructs a Position object with coordinates (x,y) |
|
| Method Summary | |
Position |
copy()
Returns a new Position with the same coordinates
as the original Position |
boolean |
equals(Position p)
Checks to see if one Position's coordinates are the same as anothers |
int |
getX()
Gets the Position's x coordinate |
int |
getY()
Gets the Position's y coordinate |
void |
set(int x,
int y)
Sets the Position's x and y coordinates |
void |
set(Position p)
Sets the Position coordinates to be equal to the
coordinates of another Position |
void |
setX(int x)
Sets the Position's x coordinate |
void |
setY(int y)
Sets the Position's y coordinate |
java.lang.String |
toString()
Represents this location as a string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Position()
Position object with coordinates (0,0).
public Position(int x,
int y)
Position object with coordinates (x,y)
x - position's x coordinatey - position's y coordinate| Method Detail |
public int getX()
Position's x coordinate
public int getY()
Position's y coordinate
public void setX(int x)
Position's x coordinate
x - The value to set the x coordinate topublic void setY(int y)
Position's y coordinate
y - The value to set the y coordinate to
public void set(int x,
int y)
Position's x and y coordinates
x - The value to set the x coordinate toy - The value to set the y coordinate topublic void set(Position p)
Position coordinates to be equal to the
coordinates of another Position
p - The Position that contains the coordinates to be set to.public Position copy()
Position with the same coordinates
as the original Position
Positionpublic boolean equals(Position p)
Position's coordinates are the same as anothers
p - The Position to test against
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||