[−][src]Struct mc_sim::run::Run
Represents a single speed run, in which barters are made and blazes are fought. The results of bartering and fighting are stored as a list of drops that can be interrogated to see exactly how lucky or unlucky the run was.
Fields
barters: Vec<Drop>
fights: Vec<Drop>
Implementations
impl Run
[src]
pub fn new(barters: Vec<Drop>, fights: Vec<Drop>) -> Self
[src]
Create a run from the results of bartering with piglins and fighting blazes.
let barters = vec![ Drop { item: Item::Gravel, roll: 0, count: 1 }, Drop { item: Item::Gravel, roll: 0, count: 1 }, Drop { item: Item::EnderPearl, roll: 0, count: 1 }, Drop { item: Item::Gravel, roll: 0, count: 1 }, Drop { item: Item::EnderPearl, roll: 0, count: 3 }, ]; let fights = vec![ Drop { item: Item::BlazeRod, roll: 0, count: 0 }, Drop { item: Item::BlazeRod, roll: 0, count: 0 }, Drop { item: Item::BlazeRod, roll: 0, count: 1 }, Drop { item: Item::BlazeRod, roll: 0, count: 0 }, Drop { item: Item::BlazeRod, roll: 0, count: 0 }, Drop { item: Item::BlazeRod, roll: 0, count: 1 }, Drop { item: Item::BlazeRod, roll: 0, count: 1 }, ]; let run = Run::new(barters, fights); assert_eq!(run.total_barters(), 5); assert_eq!(run.total_pearls(), 4); assert_eq!(run.total_fights(), 7); assert_eq!(run.total_rods(), 3);
pub fn total_barters(&self) -> u32
[src]
The total number of barters that were made in the run.
pub fn successful_barters(&self) -> u32
[src]
pub fn total_pearls(&self) -> u32
[src]
The total number of pearls that were obtained during the run.
pub fn total_fights(&self) -> u32
[src]
The total number of blazes that were killed in the run.
pub fn successful_fights(&self) -> u32
[src]
pub fn total_rods(&self) -> u32
[src]
The total number of blaze rods that were obtained during the run.
Trait Implementations
impl Clone for Run
[src]
impl Debug for Run
[src]
impl<'de> Deserialize<'de> for Run
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Run
[src]
Auto Trait Implementations
impl RefUnwindSafe for Run
[src]
impl Send for Run
[src]
impl Sync for Run
[src]
impl Unpin for Run
[src]
impl UnwindSafe for Run
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub unsafe fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,