mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 01:27:16 +08:00
Use pointer-to-members to remove a bunch of duplicated code
Remove all generate_XXX_moves() functions, use an array of pointer to members instead. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -370,6 +370,11 @@ private:
|
||||
};
|
||||
|
||||
|
||||
/// An array of member functions to dispatch attacks_square
|
||||
typedef Bitboard (Position::* Piece_attacks_fn)(Square s) const;
|
||||
extern Piece_attacks_fn piece_attacks_fn[7];
|
||||
extern void init_piece_attacks_fn();
|
||||
|
||||
////
|
||||
//// Inline functions
|
||||
////
|
||||
|
||||
Reference in New Issue
Block a user