(self, square)
Gets the piece type at the given square.
Gets the piece type at the given square.
Gets the piece type at the given square .
def piece_type_at(self, square):
        """Gets the piece type at the given square."""
        mask = BB_SQUARES[square]

        if mask & self.pawns:
            return PAWN
        elif mask & self.knights:
            return KNIGHT
        elif mask & self.bishops:
            return BISHOP
        elif mask & self.rooks:
            return ROOK
        elif mask & self.queens:
            return QUEEN
        elif mask & self.kings:
            return KING
        else:
            return NONE
def piece_type_at ( self , square ) : mask = BB_SQUARES [ square ] if mask & self . pawns : return PAWN elif mask & self . knights : return KNIGHT elif mask & self . bishops : return BISHOP elif mask & self . rooks : return ROOK elif mask & self . queens : return QUEEN elif mask & self . kings : return KING else : return NONE