simpleGamePlatform
Class Piece

java.lang.Object
  extended by simpleGamePlatform.Piece

public class Piece
extends java.lang.Object


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

defaultColor

public static final java.awt.Color defaultColor
The default color for a game piece.

Constructor Detail

Piece

public Piece()
Method Detail

getGamePlatform

public GamePlatform getGamePlatform()
Returns the game platform containing this piece.


setLabel

public Piece setLabel(java.lang.String label)
Assign a label to this piece.


getId

public int getId()
Get the unique id of this this piece.


setBounds

public Piece setBounds(double x,
                       double y,
                       double width,
                       double height)
Set a rectangular bounding area for this piece.


contains

public boolean contains(int x,
                        int y)
Returns true iff this piece contains pixel (x,y).


setColor

public Piece setColor(java.awt.Color color)
Set the color of this piece.


getX

public double getX()
Get the x position of this piece.


getY

public double getY()
Get the y position of this piece.


setX

public Piece setX(double x)
Set the x position of this piece.


setY

public Piece setY(double y)
Set the y position of this piece.


setShape

public Piece setShape(double[] X,
                      double[] Y)
Set the shape of this piece, given arrays of X coords and Y coords.


setShape

public 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.