pub struct ThreadRngAdapter;Expand description
Default RNG using rand::thread_rng() — non-deterministic, for normal gameplay.
Trait Implementations§
Source§impl GameRng for ThreadRngAdapter
impl GameRng for ThreadRngAdapter
Source§fn shuffle_cards(&mut self, cards: &mut [CardId])
fn shuffle_cards(&mut self, cards: &mut [CardId])
Shuffle a slice of CardIds in-place.
Must match
java.util.Collections.shuffle(list, rng) for parity.Source§fn next_int(&mut self, bound: i32) -> i32
fn next_int(&mut self, bound: i32) -> i32
Return a random integer in
[0, bound).
Must match java.util.Random.nextInt(bound) for parity.Source§fn call_count(&self) -> u64
fn call_count(&self) -> u64
Debug: return the total number of RNG calls made so far (if tracked).
Auto Trait Implementations§
impl Freeze for ThreadRngAdapter
impl RefUnwindSafe for ThreadRngAdapter
impl Send for ThreadRngAdapter
impl Sync for ThreadRngAdapter
impl Unpin for ThreadRngAdapter
impl UnsafeUnpin for ThreadRngAdapter
impl UnwindSafe for ThreadRngAdapter
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.