swap

fun swap(): Player

Returns a new Player instance with the opposite piece type.

Return

A new Player instance with swapped piece type and points reset to 0.