io-chess
UCI chess engine
Loading...
Searching...
No Matches
Types.h File Reference

Common type definitions and constants for the chess engine. More...

#include "chess.hpp"
Include dependency graph for Types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  SearchConstants
 Global constants related to search and evaluation boundaries.
namespace  MoveOrderConstants
 Scores used to sort moves during the move picking phase.
namespace  MoveGen
 Utility wrappers for legal and capture move generation.

Typedefs

using Board = chess::Board
 Alias for chess::Board.
using Move = chess::Move
 Alias for chess::Move.
using Movelist = chess::Movelist
 Alias for chess::Movelist.
using Color = chess::Color
 Alias for chess::Color.
using Square = chess::Square
 Alias for chess::Square.
using Piece = chess::Piece
 Alias for chess::Piece.
using PieceType = chess::PieceType
 Alias for chess::PieceType.
using Bitboard = chess::Bitboard
 Alias for chess::Bitboard.
using File = chess::File
 Alias for chess::File.
using Rank = chess::Rank
 Alias for chess::Rank.

Functions

void MoveGen::generateLegalMoves (Movelist &moves, const Board &board)
 Generates all pseudo-legal and legal moves for the given board state.
void MoveGen::generateCaptures (Movelist &moves, const Board &board)
 Generates only legal capture and promotion moves for the given board state.

Variables

constexpr int SearchConstants::INFINITE = 32000
 Absolute maximum score.
constexpr int SearchConstants::MATE_SCORE = 31500
 Base score for checkmate.
constexpr int SearchConstants::MATE_IN_MAX = MATE_SCORE - 300
 Threshold to detect mating sequences.
constexpr int SearchConstants::TB_WIN_SCORE = 31000
 Base score for a tablebase win.
constexpr int SearchConstants::TB_WIN_IN_MAX = TB_WIN_SCORE - 800
 Threshold to detect tablebase wins.
constexpr int SearchConstants::DRAW_SCORE = 0
 Score for a draw position.
constexpr int SearchConstants::CONTEMPT_FACTOR = 5
 Make draws slightly negative to encourage winning.
constexpr uint8_t SearchConstants::TT_EXACT = 0
 Transposition table entry is an exact score.
constexpr uint8_t SearchConstants::TT_ALPHA = 1
 Transposition table entry is an upper bound (failed low).
constexpr uint8_t SearchConstants::TT_BETA = 2
 Transposition table entry is a lower bound (failed high).
constexpr int SearchConstants::DEFAULT_DEPTH = 100
 Default maximum depth for search.
constexpr int SearchConstants::MAX_PLY = 128
 Maximum supported plies from root.
constexpr int SearchConstants::LMR_MIN_DEPTH = 3
 Minimum depth to consider Late Move Reductions (LMR).
constexpr int SearchConstants::NULL_MOVE_MIN_DEPTH = 4
 Minimum depth to consider Null Move Pruning.
constexpr int SearchConstants::MAX_EXTENSIONS = 8
 Maximum number of search extensions per path.
constexpr int16_t SearchConstants::INVALID_EVAL = 32001
 Special value indicating an uncomputed or invalid static evaluation.
constexpr int16_t MoveOrderConstants::HASH_MOVE_SCORE = 30000
 Highest priority for moves retrieved from the Transposition Table.
constexpr int16_t MoveOrderConstants::CAPTURE_BASE = 10000
 Base score for captures, adjusted by MVV-LVA.
constexpr int16_t MoveOrderConstants::KILLER_SCORE_1 = 9000
 Score for the primary killer move.
constexpr int16_t MoveOrderConstants::KILLER_SCORE_2 = 8000
 Score for the secondary killer move.
constexpr int16_t MoveOrderConstants::HISTORY_MAX = 8000
 Maximum possible history heuristic score.

Detailed Description

Common type definitions and constants for the chess engine.

This file wraps the underlying chess.hpp types into convenient aliases and defines globally used constants for search, move ordering, and evaluation.

Typedef Documentation

◆ Bitboard

using Bitboard = chess::Bitboard

Alias for chess::Bitboard.

◆ Board

using Board = chess::Board

Alias for chess::Board.

◆ Color

using Color = chess::Color

Alias for chess::Color.

◆ File

using File = chess::File

Alias for chess::File.

◆ Move

using Move = chess::Move

Alias for chess::Move.

◆ Movelist

using Movelist = chess::Movelist

Alias for chess::Movelist.

◆ Piece

using Piece = chess::Piece

Alias for chess::Piece.

◆ PieceType

using PieceType = chess::PieceType

Alias for chess::PieceType.

◆ Rank

using Rank = chess::Rank

Alias for chess::Rank.

◆ Square

using Square = chess::Square

Alias for chess::Square.