[][src]Struct pleco::board::movegen::MoveGen

pub struct MoveGen {}

Public move generator.

This is a wrapper type around InnerMoveGen, allowing for a more friendly API

Methods

impl MoveGen[src]

pub fn generate<L: Legality, G: GenTypeTrait>(chessboard: &Board) -> MoveList[src]

Returns MoveList of all moves for a given board, Legality & GenType.

pub fn generate_scoring<L: Legality, G: GenTypeTrait>(
    chessboard: &Board
) -> ScoringMoveList
[src]

Returns a ScoringMoveList of all moves for a given board, Legality & GenType.

pub unsafe fn extend<L: Legality, G: GenTypeTrait, MP: MVPushable>(
    chessboard: &Board,
    movelist: &mut MP
) where
    <MP as Index<usize>>::Output: Sized
[src]

Extends the current list of moves of a certain Legality, and Generation type. This method will correctly set the new length of the list.

Safety

Unsafe due to possible overwriting, as it is unaware of the current list's length.

pub unsafe fn extend_from_ptr<L: Legality, G: GenTypeTrait, MP: MVPushable>(
    chessboard: &Board,
    ptr: *mut MP::Output
) -> *mut MP::Output where
    <MP as Index<usize>>::Output: Sized
[src]

Extends the current list of moves of a certain Legality, and Generation type. Takes in a pointer to the next available (empty) index, and returns the pointer to the next open index after generating the moves

Safety

Obviously, this is extremely unsafe to use, as there is a possibility of both overwriting valid memory, or otherwise pushing in an invalid pointer.

Also, this does not update the size of the movelist inputted. It's recommended to use the method MVPushable::unchecked_set_len(...) to set the size manually after this method.

Auto Trait Implementations

impl Send for MoveGen

impl Sync for MoveGen

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.