|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.Point2D
vooga.gameEngine.core.Position
public class Position
Wrapper class for representing a 2D Position
in space.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Point2D |
---|
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float |
Constructor Summary | |
---|---|
Position()
Default constructor; creates a new Position at x = 0 and y =
0. |
|
Position(double x,
double y)
Creates a new Position given an x and y location. |
|
Position(java.awt.geom.Point2D point)
Creates a new Position given a point in space. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
int |
getIntX()
Returns the X coordinate of this Position in integer
precision. |
int |
getIntY()
Returns the Y coordinate of this Position in integer
precision. |
double |
getX()
|
double |
getY()
|
void |
move(double dx,
double dy)
Moves this position dx in the X direction and dy in the Y direction. |
void |
setLocation(double x,
double y)
|
void |
setX(double x)
Changes the x location of the current Position . |
void |
setY(double y)
Changes the y location of the current Position . |
Methods inherited from class java.awt.geom.Point2D |
---|
distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Position()
Position
at x = 0 and y =
0.
public Position(double x, double y)
Position
given an x and y location.
x
- locationy
- locationpublic Position(java.awt.geom.Point2D point)
Position
given a point in space.
point
- in spaceMethod Detail |
---|
public java.lang.Object clone()
clone
in class java.awt.geom.Point2D
public void setX(double x)
Position
.
x
- locationpublic void setY(double y)
Position
.
y
- locationpublic double getX()
getX
in class java.awt.geom.Point2D
public double getY()
getY
in class java.awt.geom.Point2D
public int getIntX()
Position
in integer
precision.
public int getIntY()
Position
in integer
precision.
public void move(double dx, double dy)
dx
- amount to move in Xdy
- amount to move in Ypublic void setLocation(double x, double y)
setLocation
in class java.awt.geom.Point2D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |