Struct reason_othello::Board [−][src]
The complete state of an Othello game, seen from one player’s perspective.
Acts as a convenient thin wrapper for bitboard
operations, at a medium
level of abstraction ideal for engines.
Board
operations are guaranteed to preserve validity contracts, but cannot
check them on creation; may cause undefined behavior if invalid data is passed
or if Board::pass
and Board::apply_move
are applied when they are not allowed.
Fields
active_bitboard: Bitboard
opponent_bitboard: Bitboard
just_passed: bool
Implementations
impl Board
[src]
pub fn get_moves(self) -> LocationListⓘNotable traits for LocationList
impl Iterator for LocationList type Item = Location;
[src]
Notable traits for LocationList
impl Iterator for LocationList type Item = Location;
Compute a list of all legal moves out of this position by the active player.
pub fn apply_move(self, loc: Location) -> Self
[src]
Compute the board after a non-pass move, without checking that this is valid. Undefined behavior if the location is occupied or not a valid move.
pub fn pass(self) -> Self
[src]
Compute the board after a pass. Results in inconsistent state if the active player has legal moves.
pub fn swap_players(self) -> Self
[src]
Compute the board from the opponent’s perspective.
pub fn score_absolute_difference(self) -> i8
[src]
Score the board for the active player as the absolute piece count difference.
Faster than Self::score_winner_gets_empties()
, but less common.
pub fn score_winner_gets_empties(self) -> i8
[src]
Score the board for the active player as as the piece count difference where empty spaces are scored for the winner.
pub fn occupied_mask(self) -> Bitboard
[src]
Get a mask of occupied spaces on the board.
pub fn empty_mask(self) -> Bitboard
[src]
Get a mask of unoccupied spaces on the board.
Trait Implementations
impl Clone for Board
[src]
impl Copy for Board
[src]
impl Debug for Board
[src]
impl Default for Board
[src]
Get the starting board for the starting player.
impl Display for Board
[src]
impl Eq for Board
[src]
impl FromStr for Board
[src]
type Err = ParseBoardError
The associated error which can be returned from parsing.
fn from_str(board_str: &str) -> Result<Self, Self::Err>
[src]
Parse a board in the FFO format, assuming Black is going first.
impl PartialEq<Board> for Board
[src]
impl StructuralEq for Board
[src]
impl StructuralPartialEq for Board
[src]
Auto Trait Implementations
impl RefUnwindSafe for Board
impl Send for Board
impl Sync for Board
impl Unpin for Board
impl UnwindSafe for Board
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
[src]
U: FromCast<T>,
impl<T> From<T> for T
[src]
impl<T> FromCast<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,