pub struct UtpInventoryItem {
pub inventory_res: ResRef,
pub droppable: bool,
pub repos_pos_x: u16,
pub repos_pos_y: u16,
}Expand description
One UTP inventory item entry from the ItemList field.
Infinite, ObjectId and Repos_PosY are declared without members:
the first two are read by the store loader rather than this one, and the
third is a spelling only non-binary sources produce.
Fields§
§inventory_res: ResRefInventory item resref (InventoryRes).
droppable: boolDroppable flag (Dropable).
CSWSItem::LoadDataFromGff re-reads this with an unconditional
literal zero, so a container-nested item with the label absent ends up
undroppable whatever its constructor set. Vanilla omits it there.
repos_pos_x: u16Repository position X (Repos_PosX).
repos_pos_y: u16Repository position Y (Repos_PosY or legacy Repos_Posy).
Implementations§
Source§impl UtpInventoryItem
impl UtpInventoryItem
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 UtpInventoryItem
impl Clone for UtpInventoryItem
Source§fn clone(&self) -> UtpInventoryItem
fn clone(&self) -> UtpInventoryItem
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 UtpInventoryItem
impl Debug for UtpInventoryItem
Source§impl Default for UtpInventoryItem
impl Default for UtpInventoryItem
Source§impl HasSchema for UtpInventoryItem
impl HasSchema for UtpInventoryItem
Source§impl PartialEq for UtpInventoryItem
impl PartialEq for UtpInventoryItem
Source§fn eq(&self, other: &UtpInventoryItem) -> bool
fn eq(&self, other: &UtpInventoryItem) -> bool
self and other values to be equal, and is used by ==.