Skip to main content

SiteTemplate

Struct SiteTemplate 

Source
pub struct SiteTemplate {
Show 37 fields pub reference: String, pub controllers: Vec<Controller>, pub materials: Vec<(i32, usize)>, pub work: i32, pub clear: Option<ClearAreaDescription>, pub max_workers: i32, pub per_area: Option<i32>, pub adjustable: bool, pub min_jobs: i32, pub max_jobs: i32, pub profession: Option<usize>, pub produce: Option<ProduceTemplate>, pub storage: Option<(u32, i32, bool)>, pub meshes: Vec<usize>, pub residence: Option<ResidenceDescription>, pub attendance: Option<i32>, pub herbalist: Option<HerbalistTemplate>, pub radius: Option<i32>, pub auto_pickup: Option<bool>, pub forester: Option<ForesterTemplate>, pub happiness: Option<HappinessDescription>, pub fishing: Option<FishingTemplate>, pub hunt: Option<HuntDescription>, pub crop_field: Option<CropFieldTemplate>, pub orchard: Option<OrchardTemplate>, pub pasture: Option<i32>, pub disease: Option<DiseaseDescription>, pub cemetery: Option<CemeteryTemplate>, pub market: Option<MarketDescription>, pub status_icon: Option<StatusIconDescription>, pub icon_height: Option<f32>, pub destroy: Option<DestroyTemplate>, pub fire: Option<FireDescription>, pub immigration: Option<ImmigrationTemplate>, pub trade: Option<TradeTemplate>, pub trade_risk: Option<(f32, i32)>, pub material_templates: Vec<Option<usize>>,
}
Expand description

The parts of a building’s descriptions construction reads.

Fields§

§reference: String

Template\X.rsc:resource.

§controllers: Vec<Controller>

The controllers in component order.

§materials: Vec<(i32, usize)>

The materials to build it: (count, raw material).

§work: i32

The building work needed, in work units.

§clear: Option<ClearAreaDescription>

ClearAreaDescription: present, flatten/stamp flag.

§max_workers: i32

WorkDescription (most workers once built).

§per_area: Option<i32>

Scale the most workers by the footprint’s area over this many cells (from the work description).

§adjustable: bool

Whether the player may change the most workers in the building’s window.

§min_jobs: i32

The fewest workers the player may set.

§max_jobs: i32

The most workers the player may set.

§profession: Option<usize>

WorkPlaceDescription.

§produce: Option<ProduceTemplate>

ConsumeProduceDescription, resolved.

§storage: Option<(u32, i32, bool)>

StorageDescription: accepted flags, capacity, per footprint cell.

§meshes: Vec<usize>

ModelDescription meshes per variant (construction stages, the last finished).

§residence: Option<ResidenceDescription>

ResidenceDescription.

§attendance: Option<i32>

AttendanceDescription capacity.

§herbalist: Option<HerbalistTemplate>

HerbalistDescription (gatherer, herbalist), resolved.

§radius: Option<i32>

RadiusDescription.

§auto_pickup: Option<bool>

AutoPickupDescription.

§forester: Option<ForesterTemplate>

ForesterDescription, resolved.

§happiness: Option<HappinessDescription>

HappinessDescription.

§fishing: Option<FishingTemplate>

FishingDescription, resolved.

§hunt: Option<HuntDescription>

HuntDescription.

§crop_field: Option<CropFieldTemplate>

CropFieldDescription.

§orchard: Option<OrchardTemplate>

OrchardDescription.

§pasture: Option<i32>

PastureDescription: the stock slot of its products’ limit.

§disease: Option<DiseaseDescription>

DiseaseDescription (fields, orchards, pastures).

§cemetery: Option<CemeteryTemplate>

CemeteryDescription’s tombstone template and its TombstoneDescription.

§market: Option<MarketDescription>

MarketDescription.

§status_icon: Option<StatusIconDescription>

StatusIconDescription (presentation), and the finished model’s height its icons stand on (ModelComponent).

§icon_height: Option<f32>

The height of the status icon above the building, if it has one.

§destroy: Option<DestroyTemplate>

DestroyDescription, resolved.

§fire: Option<FireDescription>

FireDescription (Template\Common.rsc:fire*).

§immigration: Option<ImmigrationTemplate>

ImmigrationDescription, resolved.

§trade: Option<TradeTemplate>

TradeDescription, resolved.

§trade_risk: Option<(f32, i32)>

TradeDescription /: the visitors’ disease risk trading brings, and its months.

§material_templates: Vec<Option<usize>>

The pile template of each BuildDescription material (the refunds’ piles).

Implementations§

Source§

impl SiteTemplate

Source

pub fn default_max_workers(&self, footprint: (i32, i32)) -> i32

The default number of workers of a building of footprint cells.

Original: WorkComponent::MaxWorkers, FUN_140133a90.

Trait Implementations§

Source§

impl Clone for SiteTemplate

Source§

fn clone(&self) -> SiteTemplate

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SiteTemplate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SiteTemplate

Source§

fn default() -> SiteTemplate

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.