pub struct SavedSound {Show 22 fields
pub common: GitSoundCommon,
pub active: bool,
pub commandable: bool,
pub continuous: bool,
pub fixed_variance: f32,
pub hours: u32,
pub interval: u32,
pub interval_variation: u32,
pub looping: bool,
pub max_distance: f32,
pub min_distance: f32,
pub pitch_variation: f32,
pub positional: bool,
pub random: bool,
pub random_position: bool,
pub random_range_x: f32,
pub random_range_y: f32,
pub sounds: Vec<UtsSound>,
pub tag: String,
pub times: u8,
pub volume: u8,
pub volume_variation: u8,
}Expand description
A sound emitter as stored inside a save game’s module GIT.
Fields§
§common: GitSoundCommonThe 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.
active: boolCurrently emitting (Active).
commandable: boolAccepts scripted commands (Commandable), written and never read back.
One of the base-object labels CSWSObject::LoadObjectState reads, and
LoadSounds is the only dispatcher that never calls it. So a sound is
the one owner where the save writer emits this and no load path on
either branch looks for it.
continuous: boolPlays without gaps between entries (Continuous).
fixed_variance: f32Fixed pitch variance (FixedVariance).
hours: u32Hour mask the emitter is awake for (Hours).
interval: u32Gap between plays, in milliseconds (Interval).
interval_variation: u32Random variance added to the gap (IntervalVrtn).
looping: boolRestarts the playlist when it ends (Looping).
max_distance: f32Distance at which the sound is inaudible (MaxDistance).
min_distance: f32Distance at which attenuation starts (MinDistance).
pitch_variation: f32Random pitch variance (PitchVariation).
positional: boolAttenuates with distance (Positional).
random: boolShuffles the playlist (Random).
random_position: boolMoves the emitter between plays (RandomPosition).
random_range_x: f32Random reposition range along X (RandomRangeX).
random_range_y: f32Random reposition range along Y (RandomRangeY).
sounds: Vec<UtsSound>Playlist entries (Sounds). The element shape matches a .uts
entry, so this reuses UtsSound.
Every element is struct id 0 rather than its index.
tag: StringObject tag (Tag).
times: u8Repeat count (Times).
volume: u8Volume (Volume).
volume_variation: u8Random volume variance (VolumeVrtn).
Implementations§
Source§impl SavedSound
impl SavedSound
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 SavedSound
impl SavedSound
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 SavedSound
impl Clone for SavedSound
Source§fn clone(&self) -> SavedSound
fn clone(&self) -> SavedSound
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 SavedSound
impl Debug for SavedSound
Source§impl Default for SavedSound
impl Default for SavedSound
Source§impl GitElement for SavedSound
impl GitElement for SavedSound
Source§impl HasSchema for SavedSound
impl HasSchema for SavedSound
Source§impl PartialEq for SavedSound
impl PartialEq for SavedSound
Source§fn eq(&self, other: &SavedSound) -> bool
fn eq(&self, other: &SavedSound) -> bool
self and other values to be equal, and is used by ==.