game_solver::disjoint_game

Struct DisjointImpartialNormalGame

Source
pub struct DisjointImpartialNormalGame<L: Game + NormalImpartial, R: Game + NormalImpartial> { /* private fields */ }
Expand description

Represents the disjoint sum of two impartial normal combinatorial games.

Since Game isn’t object safe, we use dyn Any internally with downcast safety.

We restrict games to being normal impartial to force implementation of the marker trait.

Trait Implementations§

Source§

impl<L: Clone + Game + NormalImpartial, R: Clone + Game + NormalImpartial> Clone for DisjointImpartialNormalGame<L, R>

Source§

fn clone(&self) -> DisjointImpartialNormalGame<L, R>

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<L: Game + Debug + NormalImpartial + 'static, R: Game + Debug + NormalImpartial + 'static> Game for DisjointImpartialNormalGame<L, R>

Source§

type Move = DisjointMove<L, R>

The type of move this game uses.
Source§

type Iter<'a> = Interleave<Map<<L as Game>::Iter<'a>, Box<dyn Fn(<L as Game>::Move) -> DisjointMove<L, R>>>, Map<<R as Game>::Iter<'a>, Box<dyn Fn(<R as Game>::Move) -> DisjointMove<L, R>>>> where L: 'a, R: 'a, L::Move: 'a, R::Move: 'a

The iterator type for possible moves.
Source§

type Player = ImpartialPlayer

Source§

type MoveError = DisjointMoveError<L, R>

Source§

fn move_count(&self) -> usize

Returns the amount of moves that have been played
Source§

fn max_moves(&self) -> Option<usize>

Get the max number of moves in a game, if any.
Source§

fn make_move(&mut self, m: &Self::Move) -> Result<(), Self::MoveError>

Makes a move.
Source§

fn possible_moves(&self) -> Self::Iter<'_>

Returns an iterator of all possible moves. Read more
Source§

fn state(&self) -> GameState<Self::Player>

Returns the current state of the game. Used for verifying initialization and is commonly called. Read more
Source§

fn player(&self) -> Self::Player

Returns the player whose turn it is. The implementation of this should be similar to either Read more
Source§

fn find_immediately_resolvable_game( &self, ) -> Result<Option<Self>, Self::MoveError>

Returns a reachable game in one move. Read more
Source§

impl<L: Game + Debug + NormalImpartial + 'static, R: Game + Debug + NormalImpartial + 'static> Normal for DisjointImpartialNormalGame<L, R>

Source§

fn state(&self) -> GameState<Self::Player>

Source§

impl<L: Game + Debug + NormalImpartial + 'static, R: Game + Debug + NormalImpartial + 'static> NormalImpartial for DisjointImpartialNormalGame<L, R>

Source§

fn split(&self) -> Option<Vec<Self>>

Splits a game into multiple separate games. Read more

Auto Trait Implementations§

§

impl<L, R> Freeze for DisjointImpartialNormalGame<L, R>
where L: Freeze, R: Freeze,

§

impl<L, R> RefUnwindSafe for DisjointImpartialNormalGame<L, R>

§

impl<L, R> Send for DisjointImpartialNormalGame<L, R>
where L: Send, R: Send,

§

impl<L, R> Sync for DisjointImpartialNormalGame<L, R>
where L: Sync, R: Sync,

§

impl<L, R> Unpin for DisjointImpartialNormalGame<L, R>
where L: Unpin, R: Unpin,

§

impl<L, R> UnwindSafe for DisjointImpartialNormalGame<L, R>
where L: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 T
where 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

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 T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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 T
where V: MultiLane<T>,

§

fn vzip(self) -> V