pub struct DummyGame { /* private fields */ }

Trait Implementations§

source§

impl Board for DummyGame

§

type Move = usize

The type used to represent moves on this board.
source§

fn next_player(&self) -> Player

Return the next player to make a move. If the board is done this is the player that did not play the last move for consistency.
source§

fn is_available_move(&self, mv: Self::Move) -> Result<bool, BoardDone>

Return whether the given move is available.
source§

fn play(&mut self, mv: Self::Move) -> Result<(), PlayError>

Play the move mv, modifying this board.
source§

fn outcome(&self) -> Option<Outcome>

The outcome of this board, is None when this games is not done yet.
source§

fn can_lose_after_move() -> bool

Whether the player who plays a move can lose by playing that move. Symbolically whether b.won_by() == Some(Winner::Player(b.next_player())) can ever be true. This may be pessimistic, returning true is always correct.
source§

fn random_available_move( &self, rng: &mut impl Rng ) -> Result<Self::Move, BoardDone>

Pick a random move from the available_moves with a uniform distribution. Can be overridden for better performance.
source§

fn clone_and_play(&self, mv: Self::Move) -> Result<Self, PlayError>

Clone this board, play mv on it and return the new board. Can be overridden for better performance.
source§

fn is_done(&self) -> bool

Whether this games is done.
source§

fn check_done(&self) -> Result<(), BoardDone>

Returns Read more
source§

fn check_can_play(&self, mv: Self::Move) -> Result<(), PlayError>

Returns Read more
source§

fn play_random_available_move( &mut self, rng: &mut impl Rng ) -> Result<(), BoardDone>

The same as self.play(self.random_available_move(rng)), but needs less error handling. Can be overridden for better performance by skipping the valid move check.
source§

fn children(&self) -> Result<BoardChildrenIterator<'_, Self>, BoardDone>

The same as self.available_moves().map(|mv| self.clone_and_play(mv)), but needs less error handling. Can be overridden for better performance by skipping the valid move check.
source§

impl<'a> BoardMoves<'a, DummyGame> for DummyGame

§

type AllMovesIterator = ClonableInternal<RangeFrom<usize>>

§

type AvailableMovesIterator = ClonableInternal<Range<usize>>

source§

fn all_possible_moves() -> Self::AllMovesIterator

All theoretically possible moves, for any possible board. Moves returned by available_moves will always be a subset of these moves. The order of these moves does not need to match the order from available_moves.
source§

fn available_moves(&'a self) -> Result<Self::AvailableMovesIterator, BoardDone>

Return an iterator over available moves, is always nonempty. No guarantees are made about the ordering except that it stays consistent when the board is not modified. Panics if this board is done.
source§

impl BoardSymmetry<DummyGame> for DummyGame

§

type Symmetry = UnitSymmetry

The type used to represent symmetries.
§

type CanonicalKey = ()

The type used by Self::canonical_key.
source§

fn map(&self, _: Self::Symmetry) -> Self

Map this board under the given symmetry.
source§

fn map_move( &self, _: Self::Symmetry, mv: <DummyGame as Board>::Move ) -> <DummyGame as Board>::Move

Map a move under the given symmetry.
source§

fn canonical_key(&self) -> Self::CanonicalKey

Extract all of the state from this board that can potentially change when calling Self::map. This is used by Self::canonicalize to determine which symmetry ends up as the canonical one for the given board.
source§

fn canonicalize(&self) -> Self

Convert this board to a canonical version, by mapping it with the symmetry that results in the smallest Self::canonical_key. Read more
source§

impl Clone for DummyGame

source§

fn clone(&self) -> DummyGame

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DummyGame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for DummyGame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for DummyGame

§

type Err = Error<String>

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for DummyGame

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<DummyGame> for DummyGame

source§

fn eq(&self, other: &DummyGame) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Alternating for DummyGame

source§

impl Eq for DummyGame

source§

impl StructuralEq for DummyGame

source§

impl StructuralPartialEq for DummyGame

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<B> AltBoard for Bwhere B: Board + Alternating,