checkers.model
Class Piece

java.lang.Object
  extended by checkers.model.Piece

public class Piece
extends java.lang.Object

This is an abstract class representing any piece that know about it's color and possible moves and captures

Author:
Jeremy Ryan

Constructor Summary
Piece(int c, int t)
          The constructor for this piece
 
Method Summary
 int getColor()
          This method returns the color of this piece
 int getType()
          Returns the type of the piece
 void setType(int t)
          Sets the Piece's type (SINGLE or KING)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Piece

public Piece(int c,
             int t)
The constructor for this piece

Parameters:
c - the color for this piece (as defined by constants Piece.WHITE and Piece.BLUE)
t - Type of the piece (as defined by constants Piece.SINGLE and Piece.KING)
Method Detail

getType

public int getType()
Returns the type of the piece

Returns:
the type of the piece

getColor

public int getColor()
This method returns the color of this piece

Returns:
the color for this piece

setType

public void setType(int t)
Sets the Piece's type (SINGLE or KING)

Parameters:
t - Type for this piece