pub struct UtiProperty {
pub cost_table: u8,
pub cost_value: u16,
pub param1: u8,
pub param1_value: u8,
pub property_name: u16,
pub subtype: u16,
pub chance_appear: u8,
pub useable: Option<bool>,
pub uses_per_day: u8,
pub upgrade_type: Option<u8>,
}Expand description
One entry of an item’s PropertiesList.
Fields§
§cost_table: u8Cost table index (CostTable).
cost_value: u16Cost table value (CostValue).
param1: u8Parameter table index (Param1).
param1_value: u8Parameter value (Param1Value).
property_name: u16Property identifier (PropertyName).
subtype: u16Property subtype (Subtype).
chance_appear: u8Chance the property appears (ChanceAppear).
useable: Option<bool>Usable flag (Useable), when the entry carries one.
uses_per_day: u8Uses per day (UsesPerDay).
No vanilla .uti carries this label on any property entry, across all
993 of them, so the omission stands in for the absence and the model
does not have to.
upgrade_type: Option<u8>Upgrade type (UpgradeType), when the entry carries one.
Held optionally because absence and an explicit 0 are both real: of
2040 property entries in the install, 1118 omit the label, 890 carry a
value and 32 carry a zero. An omission keyed on the engine’s own
absent-value would drop those 32.
The entry says the engine stamps 0 and our reader hands back None,
which the vocabulary cannot express in one place: Absent::Resolves
has no substitute slot, because it was shaped for the case where our
value is the engine’s. Recorded here until that is settled.
Implementations§
Source§impl UtiProperty
impl UtiProperty
Sourcepub const PARTS: &'static [&'static [Field]]
pub const PARTS: &'static [&'static [Field]]
This type’s schema in parts, which is what a container holding it references.
Own fields first, then one part per flattened child in the order they are declared.
Sourcepub fn read_declared(root: &GffStruct) -> Self
pub fn read_declared(root: &GffStruct) -> Self
Reads every declared field off root.
Absent fields take the entry’s own answer, so a fallback is derived from the declaration rather than restated beside it.
A field declaring a hand-written read is left at that answer for the view to overwrite.
Sourcepub fn write_declared(&self, root: &mut GffStruct)
pub fn write_declared(&self, root: &mut GffStruct)
Writes every declared field onto root, leaving out the ones
their entry says the engine’s own writer leaves out.
A field declaring a hand-written write is not touched here.
Sourcepub fn read_element(structure: &GffStruct) -> Self
pub fn read_element(structure: &GffStruct) -> Self
Reads one element of a list of this type.
Sourcepub fn write_element(&self, structure: &mut GffStruct)
pub fn write_element(&self, structure: &mut GffStruct)
Writes one element of a list of this type.
Trait Implementations§
Source§impl Clone for UtiProperty
impl Clone for UtiProperty
Source§fn clone(&self) -> UtiProperty
fn clone(&self) -> UtiProperty
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UtiProperty
impl Debug for UtiProperty
Source§impl Default for UtiProperty
impl Default for UtiProperty
Source§impl HasSchema for UtiProperty
impl HasSchema for UtiProperty
Source§impl PartialEq for UtiProperty
impl PartialEq for UtiProperty
Source§fn eq(&self, other: &UtiProperty) -> bool
fn eq(&self, other: &UtiProperty) -> bool
self and other values to be equal, and is used by ==.