Members
(static) colors
Array of piece colors
- 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'. |
- Source:
Returns:
new instance of this class.
- Type
- PieceColor
isBlack() → {boolean}
Return whether the piece is black
This:
- Source:
Returns:
boolean indicating whether the piece is black.
- Type
- boolean
isWhite() → {boolean}
Return whether the piece is white
This:
- 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:
- Source:
Returns:
string representation of this instance.
- Type
- string