pub struct History<G: Game<P>, const P: usize> { /* private fields */ }Expand description
For repeated games, a history of previously played games.
Implementations§
source§impl<G: Game<P>, const P: usize> History<G, P>
impl<G: Game<P>, const P: usize> History<G, P>
sourcepub fn add(&mut self, outcome: G::Outcome) -> &G::Outcome
pub fn add(&mut self, outcome: G::Outcome) -> &G::Outcome
Update the history by adding a new game outcome. Returns a reference to the newly added outcome.
sourcepub fn outcomes(&self) -> Past<'_, &G::Outcome> ⓘ
pub fn outcomes(&self) -> Past<'_, &G::Outcome> ⓘ
Get an iterator over the outcomes of previously played games.
sourcepub fn records(
&self,
) -> Past<'_, &<G::Outcome as Outcome<G::Move, G::Utility, P>>::Record> ⓘ
pub fn records( &self, ) -> Past<'_, &<G::Outcome as Outcome<G::Move, G::Utility, P>>::Record> ⓘ
Get an iterator over the move records of previously played games.
source§impl<M, U, G, const P: usize> History<G, P>where
M: Move,
U: Utility,
G: Game<P, Move = M, Utility = U, Outcome = SimultaneousOutcome<M, U, P>>,
impl<M, U, G, const P: usize> History<G, P>where
M: Move,
U: Utility,
G: Game<P, Move = M, Utility = U, Outcome = SimultaneousOutcome<M, U, P>>,
source§impl<M, U, G, const P: usize> History<G, P>
impl<M, U, G, const P: usize> History<G, P>
sourcepub fn transcripts(&self) -> Past<'_, &Transcript<G::Move, P>> ⓘ
pub fn transcripts(&self) -> Past<'_, &Transcript<G::Move, P>> ⓘ
Get an iterator over the transcripts of previously played games.
Trait Implementations§
source§impl<G: Game<P>, const P: usize> Outcome<<G as Game<P>>::Move, <G as Game<P>>::Utility, P> for History<G, P>
impl<G: Game<P>, const P: usize> Outcome<<G as Game<P>>::Move, <G as Game<P>>::Utility, P> for History<G, P>
source§impl<G: Game<P>, const P: usize> PartialEq for History<G, P>
impl<G: Game<P>, const P: usize> PartialEq for History<G, P>
source§impl<G: Game<P>, const P: usize> Record<<G as Game<P>>::Move, P> for History<G, P>
impl<G: Game<P>, const P: usize> Record<<G as Game<P>>::Move, P> for History<G, P>
source§fn plies(&self) -> Plies<'_, G::Move, P>
fn plies(&self) -> Plies<'_, G::Move, P>
An iterator over the played moves in this record. Read more
source§fn to_transcript(&self) -> Transcript<M, P>
fn to_transcript(&self) -> Transcript<M, P>
Get the moves played in the form of a transcript.
source§fn played_moves_by_chance(&self) -> PlayedMoves<'_, M> ⓘ
fn played_moves_by_chance(&self) -> PlayedMoves<'_, M> ⓘ
An iterator over all moves by chance.
source§fn played_moves_by_player(&self, player: PlayerIndex<P>) -> PlayedMoves<'_, M> ⓘ
fn played_moves_by_player(&self, player: PlayerIndex<P>) -> PlayedMoves<'_, M> ⓘ
An iterator over all moves by a particular player.
source§fn played_moves_per_player(&self) -> PerPlayer<PlayedMoves<'_, M>, P>
fn played_moves_per_player(&self) -> PerPlayer<PlayedMoves<'_, M>, P>
Iterators over the moves by each player.
Auto Trait Implementations§
impl<G, const P: usize> Freeze for History<G, P>
impl<G, const P: usize> RefUnwindSafe for History<G, P>
impl<G, const P: usize> Send for History<G, P>
impl<G, const P: usize> Sync for History<G, P>
impl<G, const P: usize> Unpin for History<G, P>
impl<G, const P: usize> UnwindSafe for History<G, P>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more