stellarUCI Chess engine written in C++20 |
git clone git://git.dimitrijedobrota.com/stellar.git |
Log | Files | Refs | README | LICENSE |
attack.hpp (855B)
0 #ifndef STELLAR_ATTACK_H 1 #define STELLAR_ATTACK_H 2 3 #include "utils.hpp" 4 5 #include "bishop.hpp" 6 #include "king.hpp" 7 #include "knight.hpp" 8 #include "pawn.hpp" 9 #include "queen.hpp" 10 #include "rook.hpp" 11 12 #include "piece.hpp" 13 14 namespace attack { 15 16 void init(void); 17 18 inline constexpr const U64 attack_pawn(const Color color, const Square from) { 19 return attack::pawn::attack(color, from); 20 } 21 22 inline constexpr const U64 attack(const Type type, const Square from, const U64 occupancy) { 23 switch (type) { 24 case QUEEN: return attack::queen::attack(from, occupancy); 25 case ROOK: return attack::rook::attack(from, occupancy); 26 case BISHOP: return attack::bishop::attack(from, occupancy); 27 case KING: return attack::king::attack(from); 28 case KNIGHT: return attack::knight::attack(from); 29 default: return 0; 30 } 31 } 32 33 } // namespace attack 34 35 #endif