|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.amoebacode.blackjack.display.Coordinate
Coordinate manages one point on a two-dimensional plane.
| Field Summary | |
private int |
xPos
The horizontal position of this coordinate |
private int |
yPos
The vertical position of this coordinate |
| Constructor Summary | |
Coordinate(int xPos,
int yPos)
Default public constructor. |
|
| Method Summary | |
boolean |
equals(Coordinate otherCoordinate)
Indicates whether this coordinate is in the same position as the specified coordinate. |
Coordinate |
getCopy()
Returns a copy of this coordinate. |
private double |
getXPercentDifference(Coordinate otherCoordinate)
Returns the horizontal percentage of the overall difference between this coordinate and the specified coordinate. |
int |
getXPos()
Returns the horizontal position of this coordinate. |
private double |
getYPercentDifference(Coordinate otherCoordinate)
Returns the vertical percentage of the overall difference between this coordinate and the specified coordinate. |
int |
getYPos()
Returns the vertical position of this coordinate. |
private int |
minus(Coordinate otherCoordinate)
Returns the sum of the horizontal and vertical differences between this coordinate and the specified coordinate. |
void |
move(Coordinate destCoordinate,
int pixels)
Moves this coordinate the specified number of pixels toward the specified desination, or if it is closer than the specified number of pixels, sets its position at the destination. |
private void |
movePixels(Coordinate destCoordinate,
int pixels)
Moves this coordinate the specified number of pixels toward the specified desination. |
private void |
setCoordinate(Coordinate otherCoordinate)
Sets this coordinate's position at the position of the specified coordinate. |
private int |
xMinus(Coordinate otherCoordinate)
Returns the horizontal difference between this coordinate and the specified coordinate. |
private int |
yMinus(Coordinate otherCoordinate)
Returns the vertical difference between this coordinate and the specified coordinate. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private int xPos
private int yPos
| Constructor Detail |
public Coordinate(int xPos,
int yPos)
xPos - the horizontal position of this coordinateyPos - the vertical position of this coordinate| Method Detail |
public int getXPos()
public int getYPos()
public Coordinate getCopy()
public void move(Coordinate destCoordinate,
int pixels)
destCoordinate - the destination for the movepixels - the number of pixels to movepublic boolean equals(Coordinate otherCoordinate)
otherCoordinate - the other coordinate to compareprivate int minus(Coordinate otherCoordinate)
otherCoordinate - the other coordinate to compareprivate int yMinus(Coordinate otherCoordinate)
otherCoordinate - the other coordinate to compareprivate int xMinus(Coordinate otherCoordinate)
otherCoordinate - the other coordinate to compare
private void movePixels(Coordinate destCoordinate,
int pixels)
destCoordinate - the destination for the movepixels - the number of pixels to moveprivate double getXPercentDifference(Coordinate otherCoordinate)
otherCoordinate - the other coordinate to compareprivate double getYPercentDifference(Coordinate otherCoordinate)
otherCoordinate - the other coordinate to compareprivate void setCoordinate(Coordinate otherCoordinate)
otherCoordinate - the destination position
|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||