Struct chessground::Pos
[−]
[src]
pub struct Pos { /* fields omitted */ }
A position configuration.
- Piece positions
- Legal move hints
- Check hint
- Last move hint
Methods
impl Pos
[src]
pub fn new<P: Position>(p: &P) -> Pos
[src]
Create a new position configuration.
pub fn from_board(board: Board) -> Pos
[src]
Create a position configuration from a board, without any other hints.
pub fn set_last_move(&mut self, m: Option<&Move>)
[src]
Set the hint for the last move, so that it can be highlighted on the board.
pub fn with_last_move(self, m: &Move) -> Self
[src]
pub fn set_check(&mut self, king: Option<Square>)
[src]
Set the check hint.
pub fn with_check(self, king: Square) -> Pos
[src]
pub fn set_legals(&mut self, legals: MoveList)
[src]
Set the legal move hints.
pub fn with_legals(self, legals: MoveList) -> Pos
[src]
Trait Implementations
impl Debug for Pos
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Pos
[src]
fn clone(&self) -> Pos
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more