Skip to main content

Env

Struct Env 

Source
pub struct Env<'a, 't> {
Show 13 fields pub wildlife: &'a mut Wildlife, pub cells: &'a mut Cells, pub placed: &'a mut Vec<Placed>, pub templates: &'a [Template], pub terrain: &'a HeightGrid<'t>, pub materials: &'a [RawMaterial], pub storages: &'a mut [Storage], pub sites: &'a [StorageSite], pub rng: &'a mut Random, pub construction: &'a mut Construction, pub stock: [(i32, i32); 21], pub temperature: f32, pub visits: &'a [(usize, i64)],
}
Expand description

The world the citizens’ update borrows (everything but the citizens themselves).

Fields§

§wildlife: &'a mut Wildlife

Wild animals (hunting).

§cells: &'a mut Cells

The gameplay map.

§placed: &'a mut Vec<Placed>

The placed objects.

§templates: &'a [Template]

The object templates.

§terrain: &'a HeightGrid<'t>

The ground’s heights.

§materials: &'a [RawMaterial]

The raw materials.

§storages: &'a mut [Storage]

The town’s storages.

§sites: &'a [StorageSite]

The storage sites.

§rng: &'a mut Random

The game’s random numbers.

§construction: &'a mut Construction

The construction manager.

§stock: [(i32, i32); 21]

The stock manager’s (count, limit) per slot from the last recount.

§temperature: f32

The environment’s temperature.

§visits: &'a [(usize, i64)]

This iteration’s bucket visits (EntityScheduler::take_visits): placed entities by index, citizens from scheduler::EXTRA, each with the time since its last visit.

Auto Trait Implementations§

§

impl<'a, 't> !UnwindSafe for Env<'a, 't>

§

impl<'a, 't> Freeze for Env<'a, 't>

§

impl<'a, 't> RefUnwindSafe for Env<'a, 't>

§

impl<'a, 't> Send for Env<'a, 't>

§

impl<'a, 't> Sync for Env<'a, 't>

§

impl<'a, 't> Unpin for Env<'a, 't>

§

impl<'a, 't> UnsafeUnpin for Env<'a, 't>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.