stellar

Stellar - UCI Chess engine written in C++20
git clone git://git.dimitrijedobrota.com/stellar.git
Log | Files | Refs | README | LICENSE

attack.hpp (855B)


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