BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
chess::game::ThreefoldChecker Struct Referencefinal

#include <libchess/game/ThreefoldChecker.hpp>

Public Types

using HashValue = std::uint64_t

Public Member Functions

constexpr auto is_threefold () const noexcept -> bool
constexpr void push (HashValue newHash)
constexpr void reset (HashValue initialPositionHash)

Detailed Description

This struct keeps a history of Zobrist hash values to detect threefold repetitions.

Definition at line 33 of file ThreefoldChecker.hpp.

Member Typedef Documentation

◆ HashValue

Definition at line 34 of file ThreefoldChecker.hpp.

Member Function Documentation

◆ is_threefold()

auto chess::game::ThreefoldChecker::is_threefold ( ) const -> bool
nodiscardconstexprnoexcept

Returns true if the last call to push() created a threefold repetition in the history.

Definition at line 92 of file ThreefoldChecker.hpp.

◆ push()

void chess::game::ThreefoldChecker::push ( HashValue newHash)
constexpr

Pushes a new hash value into the history.

Definition at line 76 of file ThreefoldChecker.hpp.

◆ reset()

void chess::game::ThreefoldChecker::reset ( HashValue initialPositionHash)
constexpr

Clears the history, inserting a single hash value.

Definition at line 70 of file ThreefoldChecker.hpp.


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