[][src]Trait rustenginelib::square::SquareTrait

pub trait SquareTrait {
    fn rank(self) -> Rank;
fn file(self) -> File;
fn uci(self) -> String;
fn bitboard(self) -> Bitboard;
fn add_delta(self, delta: &Delta) -> (Square, bool);
fn add_delta_occup(self, delta: &Delta, occup: Bitboard) -> (Square, bool); }

Square trait adds methods to a Square

Required methods

fn rank(self) -> Rank

returns the rank of the square

fn file(self) -> File

returns the file of the square

fn uci(self) -> String

returns the UCI representation of the square

fn bitboard(self) -> Bitboard

returns an otherwise empty bitboard with the bit for this square set

fn add_delta(self, delta: &Delta) -> (Square, bool)

adds a delta to a square and returns the resulting square together with a bool indicating whether adding was a success

fn add_delta_occup(self, delta: &Delta, occup: Bitboard) -> (Square, bool)

same as add_delta, but also fails if the resulting square is occupied

Loading content...

Implementors

impl SquareTrait for Square[src]

SquareTrait adds methods to a Square

fn rank(self) -> Rank[src]

returns the rank of the square

fn file(self) -> File[src]

returns the file of the square

fn uci(self) -> String[src]

returns the UCI representation of the square

fn bitboard(self) -> Bitboard[src]

returns an otherwise empty bitboard with the bit for this square set

fn add_delta(self, delta: &Delta) -> (Square, bool)[src]

adds a delta to a square and returns the resulting square together with a bool indicating whether adding was a success

fn add_delta_occup(self, delta: &Delta, occup: Bitboard) -> (Square, bool)[src]

same as add_delta, but also fails if the resulting square is occupied

Loading content...