BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
chess::moves::AttackInfo Struct Referencefinal

#include <libchess/moves/AttackInfo.hpp>

Collaboration diagram for chess::moves::AttackInfo:

Classes

struct  Side

Public Member Functions

constexpr auto operator== (const AttackInfo &) const noexcept -> bool=default
template<Color C>
constexpr auto side () const noexcept -> const Side &
constexpr auto side (const Color color) const noexcept -> const Side &

Public Attributes

Side black
Side white

Detailed Description

The squares attacked by each side's pieces, broken down by piece type.

These are raw attack sets: squares occupied by friendly pieces are not masked out, so a set bit on a square holding one of our own pieces means that piece is defended. Sliders don't see through other pieces (there are no x-rays).

See also
compute_attacks()

Definition at line 45 of file AttackInfo.hpp.

Member Function Documentation

◆ operator==()

auto chess::moves::AttackInfo::operator== ( const AttackInfo & ) const -> bool=default
nodiscardconstexprdefaultnoexcept

Compares two AttackInfo objects for equality.

◆ side() [1/2]

template<Color C>
auto chess::moves::AttackInfo::side ( ) const -> const Side &
inlinenodiscardconstexprnoexcept

Returns the attack sets for the given side.

Definition at line 75 of file AttackInfo.hpp.

◆ side() [2/2]

auto chess::moves::AttackInfo::side ( const Color color) const -> const Side &
inlinenodiscardconstexprnoexcept

Returns the attack sets for the given side.

Definition at line 84 of file AttackInfo.hpp.

Member Data Documentation

◆ black

Side chess::moves::AttackInfo::black

Black's attack sets.

Definition at line 71 of file AttackInfo.hpp.

◆ white

Side chess::moves::AttackInfo::white

White's attack sets.

Definition at line 68 of file AttackInfo.hpp.


The documentation for this struct was generated from the following file: