pub struct Position {
pub width: u8,
pub height: u8,
pub to_play: Color,
pub captures: [u32; 2],
pub move_number: u32,
pub last_move: Option<Played>,
pub marks: Vec<Mark>,
pub lines: Vec<Line>,
/* private fields */
}Expand description
A single board. Applications may cache a bounded number of these independently.
Fields§
§width: u8§height: u8§to_play: Color§captures: [u32; 2]Prisoners taken by Black, then White. Setup stones never count as captures.
move_number: u32§last_move: Option<Played>§marks: Vec<Mark>§lines: Vec<Line>Implementations§
Source§impl Position
impl Position
pub fn node(&self) -> NodeId
pub fn stone(&self, point: Point) -> Option<Color>
pub fn number(&self, point: Point) -> u32
Sourcepub fn advance(
&self,
doc: &Collection,
node: NodeId,
cancel: &AtomicBool,
) -> Result<Self, Error>
pub fn advance( &self, doc: &Collection, node: NodeId, cancel: &AtomicBool, ) -> Result<Self, Error>
Incremental forward navigation; the target must be a direct child.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more