pub struct Board { /* private fields */ }
Expand description
A representation of a Gobblet board.
Implementations§
source§impl Board
impl Board
pub const SIZE: usize = 4usize
pub fn new() -> Self
sourcepub fn color_combined(&self, color: Color) -> BitBoard
pub fn color_combined(&self, color: Color) -> BitBoard
Returns a bitboard viewed from above with only the given color. If a piece of a different color is stacked on top, the bit will be 0.
sourcepub fn place(&self, piece: Piece, to: Square) -> Result<Board, Error>
pub fn place(&self, piece: Piece, to: Square) -> Result<Board, Error>
Places a piece to the given square and returns the new board.
sourcepub fn move(&self, from: Square, to: Square) -> Result<Board, Error>
pub fn move(&self, from: Square, to: Square) -> Result<Board, Error>
Moves a piece from one square to another and returns the new board.
sourcepub fn can_place(&self, piece: Piece, to: Square) -> bool
pub fn can_place(&self, piece: Piece, to: Square) -> bool
Checks if a piece can be placed on the given square.
sourcepub fn can_move(&self, piece: Piece, to: Square) -> bool
pub fn can_move(&self, piece: Piece, to: Square) -> bool
Checks if a piece can be moved to the given square.