BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
chess::moves Namespace Reference

Namespaces

namespace  detail
namespace  magics
namespace  patterns
namespace  pseudo_legal

Classes

struct  AttackInfo
struct  Bitboard
struct  Move
struct  PerftResult
struct  Pieces
struct  Position
struct  Square

Typedefs

using MaybePieceType = std::optional<PieceType>
using PieceType = pieces::Type

Enumerations

enum class  Color
enum class  Color
enum class  Color
enum class  File
enum class  Rank

Functions

constexpr auto castle_kingside (const Color color) noexcept -> Move
constexpr auto castle_queenside (const Color color) noexcept -> Move
auto compute_attacks (const Position &position) -> AttackInfo
template<typename Callback>
auto compute_attacks (const Position &position, Callback &&onPieceAttacks) -> AttackInfo
template<Color Side>
constexpr auto num_squares_attacked (const Pieces &pieces, Bitboard targetSquares, Bitboard enemyPieces, bool includeKing=true) noexcept -> size_t
constexpr auto operator<=> (const Move &first, const Move &second) noexcept -> std::strong_ordering
template<bool IsRoot>
auto perft (const size_t depth, const game::Position &startingPosition) -> PerftResult
template<bool IsRoot = true>
auto perft (size_t depth, const game::Position &startingPosition) -> PerftResult
constexpr auto promotion (const File file, const Color color, const PieceType promotedType) noexcept -> Move
template<Color Side>
constexpr auto squares_attacked (const Pieces &pieces, Bitboard targetSquares, Bitboard enemyPieces) noexcept -> bool
template<size_t N>
using NMoveList = beman::inplace_vector::inplace_vector<Move, N>
using MoveList = NMoveList<MAX_MOVES>
constexpr auto MAX_MOVES = 256uz
template<bool CapturesOnly = false>
void generate (const Position &position, std::output_iterator< Move > auto outputIt)
template<bool CapturesOnly = false>
auto generate (const Position &position) -> MoveList
template<bool CapturesOnly = false>
void generate_for (const Position &position, PieceType piece, std::output_iterator< Move > auto outputIt)
template<bool CapturesOnly = false>
auto generate_for (const Position &position, PieceType piece) -> MoveList
auto any_legal_moves (const Position &position) -> bool
auto get_potentially_legal_en_passant_target_squares (const Position &position)

Detailed Description

This namespace contains classes for modeling moves.

Typedef Documentation

◆ MaybePieceType

using chess::moves::MaybePieceType = std::optional<PieceType>

Definition at line 55 of file Move.hpp.

◆ PieceType

Definition at line 54 of file Move.hpp.

Enumeration Type Documentation

◆ Color [1/3]

enum class chess::pieces::Color : std::uint_fast8_t
strong

This enum identifies the side to move.

Definition at line 29 of file Colors.hpp.

◆ Color [2/3]

enum class chess::pieces::Color : std::uint_fast8_t
strong

This enum identifies the side to move.

Definition at line 29 of file Colors.hpp.

◆ Color [3/3]

enum class chess::pieces::Color : std::uint_fast8_t
strong

This enum identifies the side to move.

Definition at line 29 of file Colors.hpp.

◆ File

enum class chess::board::File : BitboardIndex
strong

This enum describes the files of the chess board.

See also
Rank

Definition at line 36 of file File.hpp.

◆ Rank

enum class chess::board::Rank : BitboardIndex
strong

This enum describes the ranks of the chessboard.

See also
File

Definition at line 40 of file Rank.hpp.

Function Documentation

◆ castle_kingside()

auto chess::moves::castle_kingside ( const Color color) -> Move
related

Definition at line 304 of file Move.hpp.

◆ castle_queenside()

auto chess::moves::castle_queenside ( const Color color) -> Move
related

Definition at line 315 of file Move.hpp.

◆ perft()

template<bool IsRoot>
auto chess::moves::perft ( const size_t depth,
const game::Position & startingPosition ) -> PerftResult
related

Definition at line 119 of file Perft.hpp.

◆ promotion()

auto chess::moves::promotion ( const File file,
const Color color,
const PieceType promotedType ) -> Move
related

Definition at line 326 of file Move.hpp.