pub struct Utm {
pub resref: ResRef,
pub tag: String,
pub name: GffLocalizedString,
pub mark_up: i32,
pub mark_down: i32,
pub on_open_store: ResRef,
pub comment: String,
pub id: u8,
pub buy_sell_flag: u8,
pub inventory: Vec<UtmInventoryItem>,
}Expand description
Typed UTM model built from/to Gff data.
Fields§
§resref: ResRefMerchant template resref (ResRef).
tag: StringMerchant tag (Tag).
name: GffLocalizedStringLocalized merchant name (LocName).
mark_up: i32Markup percentage (MarkUp).
mark_down: i32Markdown percentage (MarkDown).
on_open_store: ResRefOn-open-store script (OnOpenStore).
comment: StringToolset comment (Comment).
id: u8Deprecated ID field (ID).
buy_sell_flag: u8What the store will trade (BuySellFlag), as the byte the file holds.
The whole byte, rather than a member per bit. Bit 0 is buy and bit 1 is
sell; the rest are unaccounted for and are preserved by being here at
all. Self::can_buy and Self::can_sell read the two that mean
something, which keeps the declared field the label’s actual value the
way every other entry in the tree is.
inventory: Vec<UtmInventoryItem>Inventory entries (ItemList).
Implementations§
Source§impl Utm
impl Utm
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.
Source§impl Utm
impl Utm
Sourcepub fn unknown_flag_bits(&self) -> u8
pub fn unknown_flag_bits(&self) -> u8
The bits of BuySellFlag nothing is known to read.