pub struct PatternsContainer {
    pub file_patterns: [u64; 64],
    pub rank_patterns: [u64; 64],
    pub diagonal_patterns: [u64; 64],
    pub jump_patterns: [u64; 64],
    pub box_patterns: [u64; 64],
    pub rail_patterns: [u64; 8],
    pub star_patterns: [u64; 64],
    pub front_patterns: [[u64; 64]; 2],
}

Fields§

§file_patterns: [u64; 64]§rank_patterns: [u64; 64]§diagonal_patterns: [u64; 64]§jump_patterns: [u64; 64]§box_patterns: [u64; 64]§rail_patterns: [u64; 8]§star_patterns: [u64; 64]§front_patterns: [[u64; 64]; 2]

Implementations§

source§

impl PatternsContainer

source

pub fn get_file(&self, square: usize) -> u64

Gets a file pattern for the square specified by square.

. . . x . . . .
. . . x . . . .
. . . x . . . .
. . . x . . . .
. . . o . . . .
. . . x . . . .
. . . x . . . .
. . . x . . . .
source

pub fn get_rank(&self, square: usize) -> u64

Gets a rank pattern for the square specified by square.

. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
x x x o x x x x
. . . . . . . .
. . . . . . . .
. . . . . . . .
source

pub fn get_diagonals(&self, square: usize) -> u64

Gets a diagonal pattern for the square specified by square_.

. . . . . . . x
x . . . . . x .
. x . . . x . .
. . x . x . . .
. . . o . . . .
. . x . x . . .
. x . . . x . .
x . . . . . x .
source

pub fn get_jumps(&self, square: usize) -> u64

Get a jumps pattern for the square specified by square.

. . . . . . . .
. . . . . . . .
. . x . x . . .
. x . . . x . .
. . . o . . . .
. x . . . x . .
. . x . x . . .
. . . . . . . .
source

pub fn get_box(&self, square: usize) -> u64

Get a box pattern for the square specified by square.

. . . . . . . .
. . . . . . . .
. . . . . . . .
. . x x x . . .
. . x o x . . .
. . x x x . . .
. . . . . . . .
. . . . . . . .
source

pub fn get_rail(&self, file: usize) -> u64

Get a rail pattern for the square specified by file.

. . x . x . . .
. . x . x . . .
. . x . x . . .
. . x . x . . .
. . x o x . . .
. . x . x . . .
. . x . x . . .
. . x . x . . .
source

pub fn get_star(&self, square: usize) -> u64

Get a star pattern for the square specified by square.

. . . . . . . .
. . . . . . . .
. . . . . . . .
. . x . x . . .
. . . o . . . .
. . x . x . . .
. . . . . . . .
. . . . . . . .
source

pub fn get_front(&self, color: usize, square: usize) -> u64

Get a front pattern for the square specified by square, from the color perspective.

. . x x x . . .
. . x x x . . .
. . x x x . . .
. . x x x . . .
. . . o . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
source

pub fn regenerate_files(&mut self)

Generates file patterns for all squares.

source

pub fn regenerate_ranks(&mut self)

Generates rank patterns for all squares.

source

pub fn regenerate_diagonals(&mut self)

Generates diagonal patterns for all squares.

source

pub fn regenerate_jumps(&mut self)

Generates jump patterns for all fiellds.

source

pub fn regenerate_boxes(&mut self)

Generates box patterns for all squares.

source

pub fn regenerate_rails(&mut self)

Generates rail patterns for all squares.

source

pub fn regenerate_stars(&mut self)

Generates star patterns for all squares.

source

pub fn regenerate_fronts(&mut self)

Generates front patterns for all squares.

Trait Implementations§

source§

impl Default for PatternsContainer

source§

fn default() -> Self

Constructs a default instance of PatternsContainer with initialized patterns.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.