[][src]Trait pleco::core::mono_traits::PlayerTrait

pub trait PlayerTrait {
    fn player() -> Player;
fn opp_player() -> Player;
fn player_idx() -> usize;
fn down(sq: SQ) -> SQ;
fn up(sq: SQ) -> SQ;
fn left(sq: SQ) -> SQ;
fn right(sq: SQ) -> SQ;
fn down_left(sq: SQ) -> SQ;
fn down_right(sq: SQ) -> SQ;
fn up_left(sq: SQ) -> SQ;
fn up_right(sq: SQ) -> SQ;
fn shift_down(bb: BitBoard) -> BitBoard;
fn shift_up(bb: BitBoard) -> BitBoard;
fn shift_left(bb: BitBoard) -> BitBoard;
fn shift_right(bb: BitBoard) -> BitBoard;
fn shift_down_left(bb: BitBoard) -> BitBoard;
fn shift_down_right(bb: BitBoard) -> BitBoard;
fn shift_up_left(bb: BitBoard) -> BitBoard;
fn shift_up_right(bb: BitBoard) -> BitBoard; }

Defines a Player Trait, allowing for specific functions in relation to a certain player.

These shouldn't be used in place of Player, as they are only used for compile-time optimizations of certain functions.

Required methods

fn player() -> Player

Return the current Player.

fn opp_player() -> Player

Return the opposing Player.

fn player_idx() -> usize

Returns the index of the player

fn down(sq: SQ) -> SQ

Given a SQ, return a square that is down relative to the current player.

fn up(sq: SQ) -> SQ

Given a SQ, return a square that is up relative to the current player.

fn left(sq: SQ) -> SQ

Given a SQ, return a square that is left relative to the current player.

fn right(sq: SQ) -> SQ

Given a SQ, return a square that is right relative to the current player.

fn down_left(sq: SQ) -> SQ

Given a SQ, return a square that is down-left relative to the current player.

fn down_right(sq: SQ) -> SQ

Given a SQ, return a square that is down-right relative to the current player.

fn up_left(sq: SQ) -> SQ

Given a SQ, return a square that is up-right relative to the current player.

fn up_right(sq: SQ) -> SQ

Given a SQ, return a square that is up-right relative to the current player.

Important traits for BitBoard
fn shift_down(bb: BitBoard) -> BitBoard

Return the same BitBoard shifted "down" relative to the current player.

Important traits for BitBoard
fn shift_up(bb: BitBoard) -> BitBoard

Return the same BitBoard shifted "up" relative to the current player.

Important traits for BitBoard
fn shift_left(bb: BitBoard) -> BitBoard

Return the same BitBoard shifted "left" relative to the current player. Does not include the left-most file in the result.

Important traits for BitBoard
fn shift_right(bb: BitBoard) -> BitBoard

Return the same BitBoard shifted "right" relative to the current player. Does not include the left-most file in the result.

Important traits for BitBoard
fn shift_down_left(bb: BitBoard) -> BitBoard

Return the same BitBoard shifted "left" and "down" relative to the current player. Does not include the left-most file in the result.

Important traits for BitBoard
fn shift_down_right(bb: BitBoard) -> BitBoard

Return the same BitBoard shifted "right" and "down" relative to the current player. Does not include the right-most file in the result.

Important traits for BitBoard
fn shift_up_left(bb: BitBoard) -> BitBoard

Return the same BitBoard shifted "left" and "up" relative to the current player. Does not include the left-most file in the result.

Important traits for BitBoard
fn shift_up_right(bb: BitBoard) -> BitBoard

Return the same BitBoard shifted "right" and "up" relative to the current player. Does not include the right-most file in the result.

Loading content...

Implementors

impl PlayerTrait for BlackType[src]

impl PlayerTrait for WhiteType[src]

Loading content...