pub struct Position { /* private fields */ }Implementations§
Source§impl Position
impl Position
pub const fn new(size: BoardSize, swap_rule: SwapRule) -> Self
pub fn from_moves( size: BoardSize, swap_rule: SwapRule, moves: &[Move], ) -> Result<Self, MoveError>
pub const fn size(self) -> BoardSize
pub const fn seat_to_move(self) -> Seat
pub const fn color_to_move(self) -> Color
pub const fn color_for_seat(self, seat: Seat) -> Color
pub const fn seat_for_color(self, color: Color) -> Seat
pub const fn colors_swapped(self) -> bool
pub const fn swap_rule(self) -> SwapRule
pub const fn swap_available(self) -> bool
pub const fn actions(self) -> u16
pub const fn stones(self) -> u16
pub const fn last_placement(self) -> Option<Cell>
pub const fn result(self) -> GameResult
pub fn color_at(self, cell: Cell) -> Option<Color>
pub fn is_legal(self, mv: Move) -> bool
pub fn legal_moves(self) -> Vec<Move>
pub fn play(self, mv: Move) -> Result<Self, MoveError>
pub fn winning_path(self) -> Vec<Cell>
Trait Implementations§
impl Copy for Position
impl Eq for Position
impl StructuralPartialEq for Position
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