pub struct UtmInventoryItem {
pub inventory_res: ResRef,
pub repos_pos_x: u16,
pub repos_pos_y: u16,
pub droppable: bool,
pub infinite: bool,
}Expand description
One UTM inventory entry from the ItemList field.
ObjectId and Repos_PosY are declared without members. The first is a
value the engine resolves that no consumer has asked for; the second is a
spelling of the row below that only non-binary sources produce.
Fields§
§inventory_res: ResRefInventory item resref (InventoryRes).
repos_pos_x: u16Repository position X (Repos_PosX). Legacy field completely ignored by the engine, which builds the UI dynamically.
repos_pos_y: u16Repository position Y (Repos_Posy). Legacy field completely ignored by the engine, which builds the UI dynamically.
The read is hand-written: it takes the Repos_PosY spelling too, which
a binary GFF cannot carry but other sources produce. The write is an
ordinary upsert of the canonical one.
droppable: boolDroppable flag (Dropable).
LoadStore’s own item loop never reads this; it comes from the item
load chain, through the same function at the same address a placeable’s
contained items reach. So the resolution transfers by identity: an
absent label lands on the read’s unconditional literal zero.
infinite: boolInfinite-stock flag (Infinite).
Implementations§
Source§impl UtmInventoryItem
impl UtmInventoryItem
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 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 UtmInventoryItem
impl Clone for UtmInventoryItem
Source§fn clone(&self) -> UtmInventoryItem
fn clone(&self) -> UtmInventoryItem
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 UtmInventoryItem
impl Debug for UtmInventoryItem
Source§impl Default for UtmInventoryItem
impl Default for UtmInventoryItem
Source§impl HasSchema for UtmInventoryItem
impl HasSchema for UtmInventoryItem
Source§impl PartialEq for UtmInventoryItem
impl PartialEq for UtmInventoryItem
Source§fn eq(&self, other: &UtmInventoryItem) -> bool
fn eq(&self, other: &UtmInventoryItem) -> bool
self and other values to be equal, and is used by ==.