pub struct SavedStore {
pub common: GitObjectPlacement,
pub buy_sell_flag: u8,
pub commandable: bool,
pub items: Vec<SavedItem>,
pub loc_name: GffLocalizedString,
pub mark_down: i32,
pub mark_up: i32,
pub on_open_store: ResRef,
pub tag: String,
}Expand description
A merchant store as stored inside a save game’s module GIT.
Fields§
§common: GitObjectPlacementThe block both forms carry, which the list declares as its element.
No #[gff]: the arm contributes its parts to the split, and the
element is this block, so declaring it here too would make one label
two declarations. The arm’s own codec reads and writes it.
buy_sell_flag: u8Whether the store buys, sells, or both (BuySellFlag).
commandable: boolAccepts scripted commands (Commandable).
items: Vec<SavedItem>Current stock (ItemList).
loc_name: GffLocalizedStringDisplayed name (LocName).
mark_down: i32Percentage taken when buying from the player (MarkDown).
mark_up: i32Percentage added when selling to the player (MarkUp).
on_open_store: ResRefOnOpenStore.
tag: StringObject tag (Tag).
Implementations§
Source§impl SavedStore
impl SavedStore
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.
Source§impl SavedStore
impl SavedStore
Sourcepub fn read_element(structure: &GffStruct) -> Self
pub fn read_element(structure: &GffStruct) -> Self
Reads one element, with the block the list declares as its element.
Sourcepub fn write_element(&self, structure: &mut GffStruct)
pub fn write_element(&self, structure: &mut GffStruct)
Writes one element, the common block included.
Trait Implementations§
Source§impl Clone for SavedStore
impl Clone for SavedStore
Source§fn clone(&self) -> SavedStore
fn clone(&self) -> SavedStore
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 SavedStore
impl Debug for SavedStore
Source§impl Default for SavedStore
impl Default for SavedStore
Source§impl GitElement for SavedStore
impl GitElement for SavedStore
Source§impl HasSchema for SavedStore
impl HasSchema for SavedStore
Source§impl PartialEq for SavedStore
impl PartialEq for SavedStore
Source§fn eq(&self, other: &SavedStore) -> bool
fn eq(&self, other: &SavedStore) -> bool
self and other values to be equal, and is used by ==.