// Properties of moves
bool legal(Move m) const;
bool pseudo_legal(const Move m) const;
+ bool capture(Move m) const;
bool capture_stage(Move m) const;
bool gives_check(Move m) const;
Piece moved_piece(Move m) const;
void undo_null_move();
// Static Exchange Evaluation
+ bool see_ge(Move m, Bitboard& occupied, Value threshold = VALUE_ZERO) const;
bool see_ge(Move m, Value threshold = VALUE_ZERO) const;
// Accessing hash keys
private:
// Initialization helpers (used while setting up a position)
void set_castling_right(Color c, Square rfrom);
- void set_state(StateInfo* si) const;
- void set_check_info(StateInfo* si) const;
+ void set_state() const;
+ void set_check_info() const;
// Other helpers
void move_piece(Square from, Square to);
return chess960;
}
+inline bool Position::capture(Move m) const {
+ assert(is_ok(m));
+ return (!empty(to_sq(m)) && type_of(m) != CASTLING)
+ || type_of(m) == EN_PASSANT;
+}
+
// returns true if a move is generated from the capture stage
// having also queen promotions covered, i.e. consistency with the capture stage move generation
// is needed to avoid the generation of duplicate moves.
inline bool Position::capture_stage(Move m) const {
assert(is_ok(m));
- return (!empty(to_sq(m)) && type_of(m) != CASTLING)
- || (type_of(m) == PROMOTION && promotion_type(m) == QUEEN)
- || type_of(m) == EN_PASSANT;
+ return capture(m) || promotion_type(m) == QUEEN;
}
inline Piece Position::captured_piece() const {