Skip to main content

Template

Struct Template 

Source
pub struct Template {
Show 36 fields pub reference: String, pub bucket: usize, pub map: Option<MapDescription>, pub model: Option<ModelDescription>, pub animations: Vec<Option<Arc<AnimationGroup>>>, pub audio_events: Vec<(String, Option<String>, f32)>, pub natural: Option<NaturalResourceDescription>, pub growth: Option<GrowthDescription>, pub fruit: Option<FruitTemplate>, pub growth_reference: Option<String>, pub spawn: Vec<(usize, f32, f32)>, pub updates: Vec<ScheduledComponent>, pub size: Option<(i32, i32)>, pub storage: Option<(u32, i32, bool)>, pub storage_location: bool, pub storage_location_flags: u32, pub storage_display: bool, pub market_radius: Option<i32>, pub market_location: bool, pub has_interact: bool, pub use_points: Vec<[f32; 3]>, pub pile: Option<usize>, pub pile_material: Option<usize>, pub pile_yield: (i32, i32), pub build_points: Vec<[f32; 3]>, pub use_yaws: Vec<f32>, pub create_points: Vec<[f32; 3]>, pub named_points: Vec<(String, [f32; 3], f32)>, pub floor: Option<Arc<Vec<[[f32; 3]; 3]>>>, pub floor_on_activate: bool, pub terraform: Option<TerraformTemplate>, pub tornado: Option<TornadoTemplate>, pub quarry: Option<QuarryTemplate>, pub trading_post: bool, pub tracker: bool, pub fenced_area: bool,
}
Expand description

The descriptions of one template that seeding reads.

Fields§

§reference: String

Template\X.rsc:resource.

§bucket: usize

ComponentDescription: scheduled bucket; 6 means unscheduled.

§map: Option<MapDescription>

The MapDescription: the footprint on the map.

§model: Option<ModelDescription>

The ModelDescription: the model’s variants.

§animations: Vec<Option<Arc<AnimationGroup>>>

ModelDescription variant animation groups, cached in the original ExternalFactory.

§audio_events: Vec<(String, Option<String>, f32)>

The AnimAudioEvents its clips fire: event resource, SoundEffect and probability.

§natural: Option<NaturalResourceDescription>

The NaturalResourceDescription (trees, rocks, crops).

§growth: Option<GrowthDescription>

The GrowthDescription.

§fruit: Option<FruitTemplate>

FruitDescription (orchard trees).

§growth_reference: Option<String>

The reference of the growth description, to compare two resources’ growth.

§spawn: Vec<(usize, f32, f32)>

Spawn entries: (index into the template table, lo, hi).

§updates: Vec<ScheduledComponent>

Scheduled component callbacks, in the ComponentDescription’s construction order.

§size: Option<(i32, i32)>

CreatePlacedDescription: building footprint size.

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

StorageDescription: accepted flags, capacity, capacity per footprint cell.

§storage_location: bool

Has a StorageLocationDescription (a town storage the starting goods go to).

§storage_location_flags: u32

The StorageLocationDescription’s accepted flags.

§storage_display: bool

Has a StorageDisplayComponent (its stored goods are drawn on its cells).

§market_radius: Option<i32>

A market’s radius.

§market_location: bool

Whether it is a market (a town storage with a radius).

§has_interact: bool

Whether it has an InteractDescription.

§use_points: Vec<[f32; 3]>

InteractDescription “use” points in model space (its point list’s category 0).

§pile: Option<usize>

A natural resource’s pile template (NaturalResourceDescription).

§pile_material: Option<usize>

A pile template’s raw material (its RawMaterialDescription).

§pile_yield: (i32, i32)

A pile template’s yields: (uneducated, educated).

§build_points: Vec<[f32; 3]>

InteractDescription “build” points in model space (category 1): where builders stand and materials are delivered.

§use_yaws: Vec<f32>

The “use” points’ yaws, in degrees.

§create_points: Vec<[f32; 3]>

The “create” points (category 2) where a workplace leaves its output.

§named_points: Vec<(String, [f32; 3], f32)>

The InteractDescription’s other named points (name, position, yaw): the trading post’s “boat”.

§floor: Option<Arc<Vec<[[f32; 3]; 3]>>>

FloorDescription: its picking mesh’s triangles in model space (bridge pieces, docks, porches).

§floor_on_activate: bool

FloorDescription: the floor is added on activation (bridge pieces); the others are added when their MultiObject is built.

Original: FUN_140124810, FUN_14012aa30.

§terraform: Option<TerraformTemplate>

TerraformDescription (tunnels).

§tornado: Option<TornadoTemplate>

TornadoDescription.

§quarry: Option<QuarryTemplate>

QuarryDescription.

§trading_post: bool

Has a TradeComponent (the trading post).

§tracker: bool

Has a TrackerComponent (workplaces whose production the window shows).

§fenced_area: bool

Whether this is a fenced area’s template (it has a createfenced component). Its model is never placed, so it stays at the origin with no rotation; Placed::yaw is its rotation on the map.

Trait Implementations§

Source§

impl Clone for Template

Source§

fn clone(&self) -> Template

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 Template

Source§

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

Formats the value using the given formatter. 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.