|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectsimpleGamePlatform.Piece
public class Piece
Field Summary | |
---|---|
static java.awt.Color |
defaultColor
The default color for a game piece. |
Constructor Summary | |
---|---|
Piece()
|
Method Summary | |
---|---|
boolean |
contains(int x,
int y)
Returns true iff this piece contains pixel (x,y). |
GamePlatform |
getGamePlatform()
Returns the game platform containing this piece. |
int |
getId()
Get the unique id of this this piece. |
double |
getX()
Get the x position of this piece. |
double |
getY()
Get the y position of this piece. |
Piece |
setBounds(double x,
double y,
double width,
double height)
Set a rectangular bounding area for this piece. |
Piece |
setColor(java.awt.Color color)
Set the color of this piece. |
Piece |
setLabel(java.lang.String label)
Assign a label to this piece. |
Piece |
setShape(double[] X,
double[] Y)
Set the shape of this piece, given arrays of X coords and Y coords. |
Piece |
setShape(double[] X,
double[] Y,
int n)
Set the shape of this piece, given arrays of X coords and Y coords, and number of points. |
Piece |
setX(double x)
Set the x position of this piece. |
Piece |
setY(double y)
Set the y position of this piece. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.awt.Color defaultColor
Constructor Detail |
---|
public Piece()
Method Detail |
---|
public GamePlatform getGamePlatform()
public Piece setLabel(java.lang.String label)
public int getId()
public Piece setBounds(double x, double y, double width, double height)
public boolean contains(int x, int y)
public Piece setColor(java.awt.Color color)
public double getX()
public double getY()
public Piece setX(double x)
public Piece setY(double y)
public Piece setShape(double[] X, double[] Y)
public Piece setShape(double[] X, double[] Y, int n)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |