Class: PieceColor

PieceColor

represents a piece color (white,black)

Constructor

new PieceColor()

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

Members

(static) colors

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

Methods

initialize(color) → {PieceColor}

creates a new instance
This:
Parameters:
Name Type Description
color string string which represents the color of the piece. Must be one of 'white' or 'black'.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
new instance of this class.
Type
PieceColor

isBlack() → {boolean}

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

isWhite() → {boolean}

Return whether the piece is white
This:
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
boolean indicating whether the piece is white.
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