Class Piece

java.lang.Object
  extended by Piece

public class Piece
extends java.lang.Object

Since:
24/11/2009
Author:
Petri Tuononen

Field Summary
static int BISHOP
           
static int BISHOP_VALUE
           
static int KING
           
static int KING_VALUE
           
static int KNIGHT
           
static int KNIGHT_VALUE
           
static int PAWN
           
static int PAWN_VALUE
           
static int QUEEN
           
static int QUEEN_VALUE
           
static int ROOK
           
static int ROOK_VALUE
           
 
Constructor Summary
Piece()
          Default constructor.
Piece(int color, int type, int row, int col)
          Constructor.
 
Method Summary
 java.lang.String getAcronym()
          Get piece type acronym.
 int getCol()
          Get column.
 int getColor()
          Get color.
 int getRow()
          Get row.
 int getType()
          Get piece type as integer.
 int getValue()
          Get value of the piece.
 void setCol(int col)
          Set column.
 void setColor(int color)
          Set color.
 void setRow(int row)
          Set row.
 void setType(int type)
          Set piece type as integer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KING

public static final int KING
See Also:
Constant Field Values

QUEEN

public static final int QUEEN
See Also:
Constant Field Values

ROOK

public static final int ROOK
See Also:
Constant Field Values

KNIGHT

public static final int KNIGHT
See Also:
Constant Field Values

BISHOP

public static final int BISHOP
See Also:
Constant Field Values

PAWN

public static final int PAWN
See Also:
Constant Field Values

KING_VALUE

public static final int KING_VALUE
See Also:
Constant Field Values

QUEEN_VALUE

public static final int QUEEN_VALUE
See Also:
Constant Field Values

ROOK_VALUE

public static final int ROOK_VALUE
See Also:
Constant Field Values

KNIGHT_VALUE

public static final int KNIGHT_VALUE
See Also:
Constant Field Values

BISHOP_VALUE

public static final int BISHOP_VALUE
See Also:
Constant Field Values

PAWN_VALUE

public static final int PAWN_VALUE
See Also:
Constant Field Values
Constructor Detail

Piece

public Piece()
Default constructor.


Piece

public Piece(int color,
             int type,
             int row,
             int col)
Constructor. Defines piece color, type and position.

Parameters:
color -
type -
row -
col -
Method Detail

getAcronym

public java.lang.String getAcronym()
Get piece type acronym.

Returns:
acro

getType

public int getType()
Get piece type as integer.

Returns:
type

setType

public void setType(int type)
Set piece type as integer.

Parameters:
type -

getValue

public int getValue()
Get value of the piece.

Returns:
int

getColor

public int getColor()
Get color.

Returns:
color

setColor

public void setColor(int color)
Set color.

Parameters:
color -

getRow

public int getRow()
Get row.

Returns:
row

setRow

public void setRow(int row)
Set row.

Parameters:
row -

getCol

public int getCol()
Get column.

Returns:
col

setCol

public void setCol(int col)
Set column.

Parameters:
col -