swap

fun swap(): Piece

Returns a new Piece with the opposite color at the same coordinate.

Return

A new Piece instance with swapped piece type.