Skip to main content

Wildlife

Struct Wildlife 

Source
pub struct Wildlife {
Show 17 fields pub tree: CharacterTree, pub populations: Vec<Population>, pub herds: Vec<Herd>, pub animals: BTreeMap<usize, Animal>, pub population_kinds: BTreeMap<usize, PopulationKind>, pub herd_kinds: BTreeMap<usize, HerdKind>, pub animal_kinds: BTreeMap<usize, AnimalKind>, pub groups: BTreeMap<(usize, usize), Arc<AnimationGroup>>, pub dying: Vec<usize>, pub livestock_kinds: BTreeMap<usize, LivestockKind>, pub unassigned: Vec<usize>, pub pastures: BTreeMap<usize, Pasture>, pub pasture_list: Vec<usize>, pub nomads: BTreeMap<usize, Nomad>, pub nomad_kinds: BTreeMap<usize, NomadKind>, pub boats: BTreeMap<usize, Boat>, pub boat_kinds: BTreeMap<usize, BoatKind>, /* private fields */
}
Expand description

The wildlife of a town.

Fields§

§tree: CharacterTree

The characters’ spatial tree (Game): citizens, animals, boats and nomads.

§populations: Vec<Population>

The animal populations.

§herds: Vec<Herd>

The herds.

§animals: BTreeMap<usize, Animal>

Animals by entity.

§population_kinds: BTreeMap<usize, PopulationKind>

Templates by placed-object template index.

§herd_kinds: BTreeMap<usize, HerdKind>

The herd templates, by placed-object template index.

§animal_kinds: BTreeMap<usize, AnimalKind>

The animal templates, by placed-object template index.

§groups: BTreeMap<(usize, usize), Arc<AnimationGroup>>

Animation groups by animal template and model variant.

§dying: Vec<usize>

Entities queued for removal, in order.

§livestock_kinds: BTreeMap<usize, LivestockKind>

LivestockDescriptions by animal template.

§unassigned: Vec<usize>

The town’s livestock without a pasture, in order.

§pastures: BTreeMap<usize, Pasture>

The pastures, by entity.

§pasture_list: Vec<usize>

The town’s list of pastures.

§nomads: BTreeMap<usize, Nomad>

The nomads, by entity.

§nomad_kinds: BTreeMap<usize, NomadKind>

The nomad templates, by template.

§boats: BTreeMap<usize, Boat>

The trader boats, by entity.

§boat_kinds: BTreeMap<usize, BoatKind>

The boat templates, by template.

Implementations§

Source§

impl Wildlife

Source

pub fn restore_population(&mut self, p: Population) -> usize

A saved PopulationComponent; returns its index.

Original: FUN_140054e00.

Source

pub fn restore_herd(&mut self, h: Herd) -> usize

A saved HerdComponent; returns its index.

Original: FUN_140127460.

Source

pub fn restore_animal(&mut self, entity: usize, a: Animal)

Restore an animal from a save: its animal component, its wild animal component, its character and its livestock component.

Original: FUN_14010c310 (the animal component).

Source

pub fn kill(&mut self, a: usize)

An animal dies (killed by a hunter, of old age, or in a herd without a habitat): it is queued for removal and leaves its herd.

Original: FUN_1400c8370 on the animal.

Source

pub fn capacity(&self, p: usize) -> i32

The animals a pasture has room for, its area over the kind’s space per animal (none without a kind).

Original: FUN_14012da40.

Source

pub fn group(&self, a: &Animal) -> Option<&AnimationGroup>

The animation group of an animal.

Trait Implementations§

Source§

impl Default for Wildlife

Source§

fn default() -> Wildlife

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.