[][src]Struct mc_sim::stream::Stream

pub struct Stream {
    pub runs: Vec<Run>,
    pub goals: Vec<RunGoals>,
}

A single 'stream' of minecraft speed runs. I.E. A list of speed runs.

Fields

runs: Vec<Run>goals: Vec<RunGoals>

Implementations

impl Stream[src]

pub fn simulate(
    barter_drop_sim: &mut DropSim,
    blaze_drop_sim: &mut DropSim,
    goals: Vec<RunGoals>
) -> Self
[src]

Simulate the stream from drop lists for bartering and blazes, and a list of goals per run.

let mut barter_drop_sim = DropSim::new(drop_list::barter_drop_list(10, 10).list_clone());
let mut blaze_drop_sim = DropSim::new(drop_list::blaze_drop_list(7).list_clone());
let goals = vec![
    RunGoals { target_pearls: 10, target_rods: 7 },
    RunGoals { target_pearls: 10, target_rods: 6 },
    RunGoals { target_pearls: 10, target_rods: 8 },
    RunGoals { target_pearls: 10, target_rods: 7 },
];

let stream = Stream::simulate(&mut barter_drop_sim, &mut blaze_drop_sim, goals);

assert!(stream.total_pearls() >= 40);
assert!(stream.total_rods() >= 28);
assert_eq!(stream.runs.len(), 4);
assert!(stream.runs[2].total_rods() >= 8);

pub fn total_barters(&self) -> u32[src]

The total number of barters made across all runs in the stream.

pub fn successful_barters(&self) -> u32[src]

pub fn total_pearls(&self) -> u32[src]

The total number of pearls picked up across all runs in the stream.

pub fn total_fights(&self) -> u32[src]

The total number of blazes killed across all runs in the stream.

pub fn successful_fights(&self) -> u32[src]

pub fn total_rods(&self) -> u32[src]

The total number of blaze rods picked up across all runs in the stream.

pub fn results(&self) -> StreamResults[src]

A summary of the results of the stream.

Trait Implementations

impl Clone for Stream[src]

impl Debug for Stream[src]

impl<'de> Deserialize<'de> for Stream[src]

impl Serialize for Stream[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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