struct StateInfo {
Key key, pawnKey, materialKey;
- int castleRights, rule50;
+ int castleRights, rule50, pliesFromNull;
Square epSquare;
Value mgValue, egValue;
Value npMaterial[2];
// Piece lists
Square piece_list(Color c, PieceType pt, int index) const;
+ const Square* piece_list_begin(Color c, PieceType pt) const;
// Information about attacks to or from a given square
Bitboard attackers_to(Square s) const;
bool move_is_check(Move m) const;
bool move_is_check(Move m, Bitboard dcCandidates) const;
bool move_is_capture(Move m) const;
+ bool move_is_capture_or_promotion(Move m) const;
bool move_is_passed_pawn_push(Move m) const;
bool move_attacks_square(Move m, Square s) const;
return pieceList[c][pt][index];
}
+inline const Square* Position::piece_list_begin(Color c, PieceType pt) const {
+ return pieceList[c][pt];
+}
+
inline Square Position::ep_square() const {
return st->epSquare;
}
inline bool Position::move_is_capture(Move m) const {
// Move must not be MOVE_NONE !
+ return (m & (3 << 15)) ? !move_is_castle(m) : !square_is_empty(move_to(m));
+}
- return (!square_is_empty(move_to(m)) && !move_is_castle(m)) || move_is_ep(m);
+inline bool Position::move_is_capture_or_promotion(Move m) const {
+
+ // Move must not be MOVE_NONE !
+ return (m & (0x1F << 12)) ? !move_is_castle(m) : !square_is_empty(move_to(m));
}
#endif // !defined(POSITION_H_INCLUDED)