fn get_next_move<const DIAG: bool>(
    context: &mut SearchContext,
    stage: &mut MoveGeneratorStage,
    moves: &mut [MaybeUninit<Move>; 218],
    move_scores: &mut [MaybeUninit<i16>; 218],
    move_index: &mut usize,
    move_number: &mut usize,
    moves_count: &mut usize,
    evasion_mask: &mut u64,
    hash_move: Move,
    ply: u16,
    friendly_king_checked: bool
) -> Option<(Move, i16)>
Expand description

Gets a next move to analyze. This function acts as pseudo-iterator and takes care about managing move generator stages, which is basically a state machine (https://en.wikipedia.org/wiki/Finite-state_machine) with following rules:

Both MoveGeneratorStage::ReadyToGenerateCaptures and MoveGeneratorStage::ReadyToGenerateQuietMoves are generating moves and assigning scores for move ordering purposes. If the last stage is set and there are no more moves, None is returned.