89 const Square& square)
noexcept
141 const auto firstFile = std::to_underlying(first.file);
142 const auto secondFile = std::to_underlying(second.file);
144 const auto [minFile, maxFile] = std::minmax(firstFile, secondFile);
153 const auto firstRank = std::to_underlying(first.rank);
154 const auto secondRank = std::to_underlying(second.rank);
156 const auto [minRank, maxRank] = std::minmax(firstRank, secondRank);
176 const Square& square)
noexcept
179 auto file =
static_cast<int>(square.file);
180 auto rank =
static_cast<int>(square.rank);
195 return std::max(fileDist, rankDist);
std::uint_fast8_t BitboardIndex
auto knight_distance(const Square &first, const Square &second) -> BitboardIndex
constexpr auto center_manhattan_distance(const Square &square) noexcept -> BitboardIndex
constexpr auto file_distance(const Square &first, const Square &second) noexcept -> BitboardIndex
constexpr auto chebyshev_distance(const Square &first, const Square &second) noexcept -> BitboardIndex
constexpr auto rank_distance(const Square &first, const Square &second) noexcept -> BitboardIndex
constexpr auto manhattan_distance(const Square &first, const Square &second) noexcept -> BitboardIndex
constexpr auto are_on_same_diagonal(const Square &first, const Square &second) noexcept -> bool