Skip to content

Latest commit

 

History

History
13 lines (7 loc) · 530 Bytes

piece.md

File metadata and controls

13 lines (7 loc) · 530 Bytes

Piece

The \Pchess\Chess\Piece class is a simple value object representing a piece in \Pchess\Chess\Chess.

The object is composed of a $type and a $color (both are a single-character string).

The type can be "k", "q", "r", "b", "n", or "p" (respectively King, Queen, Rook, Bishop, Knight, or Pawn).

The color can be "b" (black) or "w" (white).

The string representation is piece type, in uppercase when white and in lowercase when black. For example, "B" is a white Bishop, while "q" is a black Queen.