[][src]Enum screeps::constants::Density

#[repr(u8)]pub enum Density {
    Low,
    Moderate,
    High,
    Ultra,
}

Translates the DENSITY_* constants.

Variants

Low
Moderate
High
Ultra

Implementations

impl Density[src]

pub fn amount(self) -> u32[src]

Translates the MINERAL_DENSITY constant.

pub fn probability(self) -> f32[src]

Translates the MINERAL_DENSITY_PROBABILITY constant.

These are values intended for subsequent percentage checks in the order Low -> Medium -> High -> Ultra. Use the Density::iter_values iterator to iterate in this order.

pub fn iter_values() -> impl Iterator<Item = Density>[src]

Trait Implementations

impl Clone for Density[src]

impl Copy for Density[src]

impl Debug for Density[src]

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

impl Eq for Density[src]

impl FromPrimitive for Density[src]

impl Hash for Density[src]

impl IntoEnumIterator for Density[src]

type Iterator = DensityEnumIterator

Type of the iterator over the variants.

impl PartialEq<Density> for Density[src]

impl Serialize for Density[src]

impl StructuralEq for Density[src]

impl StructuralPartialEq for Density[src]

impl TryFrom<Value> for Density[src]

type Error = ConversionError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Density

impl Send for Density

impl Sync for Density

impl Unpin for Density

impl UnwindSafe for Density

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, U> IntoExpectedType<U> for T where
    U: FromExpectedType<T>, 
[src]

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<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.