pieceAt method

Piece? pieceAt(
  1. Square square
)

Gets the Piece at this Square, if any.

Implementation

Piece? pieceAt(Square square) {
  final side = sideAt(square);
  if (side == null) {
    return null;
  }
  final role = roleAt(square)!;
  final prom = promoted.has(square);
  return Piece(color: side, role: role, promoted: prom);
}