blunders_engine/
movelist.rs

1//! MoveList types used in Blunders engine.
2//!
3//! The underlying type of MoveList may change at any time during
4//! pre-1.0 development, so a MoveList type alias makes changes easy.
5
6use crate::arrayvec::ArrayVec;
7use crate::coretypes::{Move, MoveInfo};
8use crate::coretypes::{MAX_DEPTH, MAX_HISTORY, MAX_MOVES};
9
10/// MoveList is a container that can hold at most `MAX_MOVES`, the most number of moves per any chess position.
11/// Mainly used for holding all the legal or pseudo-legal moves for any single chess position.
12pub type MoveList = ArrayVec<Move, MAX_MOVES>;
13
14/// MoveInfoList is like MoveList however it also holds metadata for its moves.
15pub type MoveInfoList = ArrayVec<MoveInfo, MAX_MOVES>;
16
17/// Line is a sequence of legal moves that can be applied to a position. Useful for retaining a principal variation
18/// found from a search.
19/// Mainly used for retaining a principal variation found through search.
20pub type Line = ArrayVec<Move, { MAX_DEPTH as usize }>;
21
22/// MoveHistory stores the sequence of moves that have been applied to some base position.
23/// The size limit of this is the longest contiguous game that Blunders can support.
24pub type MoveHistory = ArrayVec<Move, MAX_HISTORY>;