home / fornax-v3-0 / src / moving / oracle.hpp

oracle.hpp



//
//  oracle.hpp
//  fornax3
//
//  Created by Anders on 04/10/2021.
//

#ifndef oracle_hpp
#define oracle_hpp

#include "../bits.h"

extern bits64* oracle_king_attacks;
extern bits64* oracle_knight_attacks;
extern bits64* oracle_sliding_attacks;
extern bits64* oracle_king_pawn_shield;

static inline bits64 oracle_get_king_attacks(square position) {
  assert(position < 64);
  return oracle_king_attacks[position];
}

static inline bits64 oracle_get_knight_attacks(square position) {
  assert(position < 64);
  return oracle_knight_attacks[position];
}

static inline bits64 oracle_get_king_pawn_shield_area(square position) {
  assert(position < 64);
  return oracle_king_pawn_shield[position];
}

template<direction dir>
static constexpr bits64 oracle_get_slide(square position) {
  assert(position < 64);
return oracle_sliding_attacks[position * 8 + dir];
}

void oracle_destroy(void);
void oracle_init(void);

#endif /* oracle_hpp */