|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unifreiburg.informatik.tetris.game.block.CartPt
public class CartPt
Field Summary | |
---|---|
(package private) int |
x
|
(package private) int |
y
|
Constructor Summary | |
---|---|
CartPt(int x,
int y)
Creates a new Point with coordinates x and y. |
Method Summary | |
---|---|
CartPt |
add(CartPt that)
Returns a new point that represents the sum of the two points. |
int |
getX()
Returns the x coordinate of the point. |
int |
getY()
Returns the y coordinate of the point. |
void |
move(CartPt that)
Moves the point, so p1.move(p2) does p1.x = p1.x + p2.x and p1.y = p1.y + p2.y. |
(package private) void |
moveDown(int y)
Moves the point down by y steps. |
CartPt |
rotateClockwise(CartPt that)
Rotates the point (this) clockwise by 90 degrees around the parameter (that). |
CartPt |
rotateCounterClockwise(CartPt that)
Rotates the point (this) counter clockwise by 90 degrees around the parameter (that). |
boolean |
samePos(CartPt that)
Check if the two points are at the same position. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
int x
int y
Constructor Detail |
---|
public CartPt(int x, int y)
x
- y
- Method Detail |
---|
public int getX()
public int getY()
public boolean samePos(CartPt that)
that
-
public void move(CartPt that)
that
- public CartPt add(CartPt that)
that
-
public CartPt rotateClockwise(CartPt that)
that
- is the center of rotation
public CartPt rotateCounterClockwise(CartPt that)
that
- is the center of rotation
void moveDown(int y)
y
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |