- PieceType threat = PAWN;
- if (targets & pos.pieces(Them, KNIGHT)) threat = KNIGHT;
- if (targets & pos.pieces(Them, BISHOP)) threat = BISHOP;
- if (targets & pos.pieces(Them, ROOK)) threat = ROOK;
- if (targets & pos.pieces(Them, QUEEN)) threat = QUEEN;
-
- return threat_values[threat];