[−][src]Trait pleco::core::mono_traits::PlayerTrait
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 BitBoardfn shift_down(bb: BitBoard) -> BitBoard
Return the same BitBoard shifted "down" relative to the current player.
ⓘImportant traits for BitBoardfn shift_up(bb: BitBoard) -> BitBoard
Return the same BitBoard shifted "up" relative to the current player.
ⓘImportant traits for BitBoardfn 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 BitBoardfn 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 BitBoardfn 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 BitBoardfn 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 BitBoardfn 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 BitBoardfn 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.