Class: PieceType

PieceType

represents a piece type (rook,knight,bishop,queen,king,pawn)

Constructor

new PieceType()

Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

Members

(static) types

Array of piece types
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

Methods

initialize(type) → {PieceType}

creates a new instance
This:
Parameters:
Name Type Description
type string the type of the piece.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
the new instance.
Type
PieceType

isBishop() → {boolean}

Return whether the piece is a bishop
This:
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
is this piece a bishop.
Type
boolean

isKing() → {boolean}

Return whether the piece is a king
This:
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
is this piece a king.
Type
boolean

isKnight() → {boolean}

Return whether the piece is a knight
This:
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
is this piece a knight.
Type
boolean

isPawn() → {boolean}

Return whether the piece is a pawn
This:
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
is this piece a pawn.
Type
boolean

isQueen() → {boolean}

Return whether the piece is a queen
This:
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
is this piece a queen.
Type
boolean

isRook() → {boolean}

Return whether the piece is a rook
This:
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
is this piece a rook.
Type
boolean

toString() → {string}

toString method that allows you to get a nice printout for this type
This:
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
string representation of this instance.
Type
string