pub struct SavedPlaceable {Show 53 fields
pub items: Vec<SavedItem>,
pub placement: Placement,
pub saves: SavingThrows,
pub lock: LockState,
pub portrait: SavedPortrait,
pub trap_detectable: bool,
pub trap_disarmable: bool,
pub trap_one_shot: bool,
pub trap_type: u8,
pub trap_detect_dc: u8,
pub trap_disarm_dc: u8,
pub trap_flag: u8,
pub on_closed: ResRef,
pub on_damaged: ResRef,
pub on_death: ResRef,
pub on_disarm: ResRef,
pub on_heartbeat: ResRef,
pub on_lock: ResRef,
pub on_melee_attacked: ResRef,
pub on_open: ResRef,
pub on_spell_cast_at: ResRef,
pub on_trap_triggered: ResRef,
pub on_unlock: ResRef,
pub on_user_defined: ResRef,
pub common: GitPlaceableCommon,
pub animation: i32,
pub body_bag: u8,
pub commandable: bool,
pub conversation: ResRef,
pub current_hp: i16,
pub description: GffLocalizedString,
pub die_when_empty: bool,
pub faction: u32,
pub ground_pile: bool,
pub hp: i16,
pub hardness: u8,
pub has_inventory: bool,
pub is_body_bag: bool,
pub is_body_bag_visible: bool,
pub is_corpse: bool,
pub light_state: u8,
pub loc_name: GffLocalizedString,
pub min1_hp: bool,
pub on_dialog: ResRef,
pub on_end_dialogue: ResRef,
pub on_inv_disturbed: ResRef,
pub on_used: ResRef,
pub open: bool,
pub party_interact: bool,
pub plot: bool,
pub is_static: bool,
pub tag: String,
pub useable: bool,
}Expand description
A placeable as stored inside a save game’s module GIT.
Fields§
§items: Vec<SavedItem>Inventory the placeable holds (ItemList).
Struct id 0 throughout, like a creature’s own inventory and unlike a
store’s, which really is positional. The id a list of items takes is
decided by the list that owns it rather than by the element type.
placement: PlacementPlacement, whose four labels sit at this object’s own level.
saves: SavingThrowsSaving throws, likewise flat on the object.
lock: LockStateLock state, likewise flat on the object.
portrait: SavedPortraitPortrait, as whichever of the two labels the object carries.
Declared per owner rather than shared: the audit parts Portrait and
PortraitId across doors, placeables and triggers on the absent axis.
Both halves are this type’s, because one member stands for two labels
and which one is written depends on the variant.
trap_detectable: boolWhether the trap can be spotted (TrapDetectable).
trap_disarmable: boolWhether the trap can be disarmed (TrapDisarmable).
trap_one_shot: boolWhether the trap fires once and clears (TrapOneShot).
trap_type: u8Trap row in traps.2da (TrapType).
trap_detect_dc: u8Difficulty of spotting the trap (TrapDetectDC).
trap_disarm_dc: u8Difficulty of disarming it (DisarmDC).
trap_flag: u8Whether a trap is present at all (TrapFlag).
on_closed: ResRefFired when the object closes (OnClosed).
on_damaged: ResRefFired when it takes damage (OnDamaged).
on_death: ResRefFired when it is destroyed (OnDeath).
on_disarm: ResRefFired when its trap is disarmed (OnDisarm).
on_heartbeat: ResRefFired on the object heartbeat (OnHeartbeat).
on_lock: ResRefFired when it is locked (OnLock).
on_melee_attacked: ResRefFired when it is struck in melee (OnMeleeAttacked).
on_open: ResRefFired when it opens (OnOpen).
on_spell_cast_at: ResRefFired when a spell targets it (OnSpellCastAt).
on_trap_triggered: ResRefFired when its trap goes off (OnTrapTriggered).
on_unlock: ResRefFired when it is unlocked (OnUnlock).
on_user_defined: ResRefFired on a user-defined event (OnUserDefined).
common: GitPlaceableCommonThe 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.
animation: i32Current animation state (Animation).
body_bag: u8Body-bag row (BodyBag).
commandable: boolAccepts scripted commands (Commandable).
conversation: ResRefAttached conversation (Conversation).
current_hp: i16Current hit points (CurrentHP).
description: GffLocalizedStringDescription (Description).
die_when_empty: boolDestroy the object once emptied (DieWhenEmpty).
faction: u32Faction id (Faction).
ground_pile: boolRenders as a loose pile rather than a container (GroundPile).
hp: i16Maximum hit points (HP).
hardness: u8Damage reduction (Hardness).
has_inventory: boolHolds an inventory (HasInventory).
is_body_bag: boolIs a body bag (IsBodyBag).
is_body_bag_visible: boolBody bag is visible (IsBodyBagVisible).
is_corpse: boolIs a corpse (IsCorpse).
light_state: u8Light state (LightState).
loc_name: GffLocalizedStringDisplayed name (LocName).
min1_hp: boolCannot be reduced below 1 HP (Min1HP).
on_dialog: ResRefOnDialog.
on_end_dialogue: ResRefOnEndDialogue.
on_inv_disturbed: ResRefOnInvDisturbed.
on_used: ResRefOnUsed.
open: boolCurrently open (Open).
party_interact: boolParty members may use it directly (PartyInteract).
plot: boolPlot flag (Plot).
is_static: boolStatic, non-interactive geometry (Static).
tag: StringObject tag (Tag).
useable: boolCan be interacted with at all (Useable).
Implementations§
Source§impl SavedPlaceable
impl SavedPlaceable
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 SavedPlaceable
impl SavedPlaceable
Sourcepub fn read_element(structure: &GffStruct) -> Self
pub fn read_element(structure: &GffStruct) -> Self
Reads one element, resolving the portrait’s two labels into one value.
Sourcepub fn write_element(&self, structure: &mut GffStruct)
pub fn write_element(&self, structure: &mut GffStruct)
Writes one element, emitting whichever portrait label the value uses.
Trait Implementations§
Source§impl Clone for SavedPlaceable
impl Clone for SavedPlaceable
Source§fn clone(&self) -> SavedPlaceable
fn clone(&self) -> SavedPlaceable
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 SavedPlaceable
impl Debug for SavedPlaceable
Source§impl Default for SavedPlaceable
impl Default for SavedPlaceable
Source§impl GitElement for SavedPlaceable
impl GitElement for SavedPlaceable
Source§impl HasSchema for SavedPlaceable
impl HasSchema for SavedPlaceable
Source§impl PartialEq for SavedPlaceable
impl PartialEq for SavedPlaceable
Source§fn eq(&self, other: &SavedPlaceable) -> bool
fn eq(&self, other: &SavedPlaceable) -> bool
self and other values to be equal, and is used by ==.