Struct LinearGame

Source
pub struct LinearGame {
    pub states: Vec<State>,
    pub state_ptr: usize,
    pub nodes: usize,
}
Expand description

LinearGame represents a single variantion chess game

Fields§

§states: Vec<State>§state_ptr: usize§nodes: usize

Implementations§

Source§

impl LinearGame

LinearGame implementation

Source

pub fn new() -> LinearGame

returns a new empty LinearGame

Source

pub fn current(&mut self) -> &mut State

current returns the current state of the game

Source

pub fn pretty_print_string(&mut self) -> String

returns the game as pretty printable string

Source

pub fn print(&mut self)

prints the game

Source

pub fn init(&mut self, variant: Variant)

initializes game to variant

Source

pub fn push(&mut self, mv: Move)

pushes a move

Source

pub fn pop(&mut self)

pops a state

Source

pub fn push_by_index(&mut self, index: usize) -> bool

pushes a move by index in state move buff

Source

pub fn perft_rec(&mut self, depth: usize)

Source

pub fn perft(&mut self, depth: usize) -> (usize, f32, f32)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V