Struct inanis::state::patterns::PatternsContainer
source · 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
impl PatternsContainer
sourcepub fn get_file(&self, square: usize) -> u64
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 . . . .
sourcepub fn get_rank(&self, square: usize) -> u64
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
. . . . . . . .
. . . . . . . .
. . . . . . . .
sourcepub fn get_diagonals(&self, square: usize) -> u64
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 .
sourcepub fn get_jumps(&self, square: usize) -> u64
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 . . .
. . . . . . . .
sourcepub fn get_box(&self, square: usize) -> u64
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 . . .
. . . . . . . .
. . . . . . . .
sourcepub fn get_rail(&self, file: usize) -> u64
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 . . .
sourcepub fn get_star(&self, square: usize) -> u64
pub fn get_star(&self, square: usize) -> u64
Get a star pattern for the square specified by square
.
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . x . x . . .
. . . o . . . .
. . x . x . . .
. . . . . . . .
. . . . . . . .
sourcepub fn get_front(&self, color: usize, square: usize) -> u64
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 . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
sourcepub fn regenerate_files(&mut self)
pub fn regenerate_files(&mut self)
Generates file patterns for all squares.
sourcepub fn regenerate_ranks(&mut self)
pub fn regenerate_ranks(&mut self)
Generates rank patterns for all squares.
sourcepub fn regenerate_diagonals(&mut self)
pub fn regenerate_diagonals(&mut self)
Generates diagonal patterns for all squares.
sourcepub fn regenerate_jumps(&mut self)
pub fn regenerate_jumps(&mut self)
Generates jump patterns for all fiellds.
sourcepub fn regenerate_boxes(&mut self)
pub fn regenerate_boxes(&mut self)
Generates box patterns for all squares.
sourcepub fn regenerate_rails(&mut self)
pub fn regenerate_rails(&mut self)
Generates rail patterns for all squares.
sourcepub fn regenerate_stars(&mut self)
pub fn regenerate_stars(&mut self)
Generates star patterns for all squares.
sourcepub fn regenerate_fronts(&mut self)
pub fn regenerate_fronts(&mut self)
Generates front patterns for all squares.
Trait Implementations§
source§impl Default for PatternsContainer
impl Default for PatternsContainer
source§fn default() -> Self
fn default() -> Self
Constructs a default instance of PatternsContainer with initialized patterns.