pub struct GitEncounter {
pub geometry: Vec<GitEncounterPoint>,
pub spawn_points: Vec<GitSpawnPoint>,
pub object_id: Option<ObjectId>,
pub template_resref: Option<ResRef>,
pub x_position: f32,
pub y_position: f32,
pub z_position: f32,
}Expand description
An encounter instance placed in the area (struct type 7).
Fields§
§geometry: Vec<GitEncounterPoint>The encounter’s boundary (Geometry).
spawn_points: Vec<GitSpawnPoint>Where its creatures appear (SpawnPointList).
object_id: Option<ObjectId>Runtime object ID (ObjectId). Save-game only.
The label belongs to the area-level list dispatcher on both sides, not
to the per-type encounter functions. SaveEncounters writes it off the
live object’s id before handing the rest of the element to
SaveEncounter, which never touches it, mirroring the read. That is
why it is here despite the per-type save function not writing it, and
why every encounter element in the local save backup carries it with a
non-zero value.
Runtime object id (ObjectId), which only a saved form carries.
The area-level dispatcher reads it once per element ahead of the static-versus-saved branch, so the engine reads it on both forms and the liveness below is right. What it does not do is author it: every element the engine saves carries one and no element the toolset shipped does. Held as the absence so writing a static placement back does not invent a runtime id for it.
template_resref: Option<ResRef>Template resref (TemplateResRef), which only a static placement has.
The mirror image of ObjectId above, on the one list with no arms to
keep the two forms apart: every one of the 51 install elements carries
it and none of the 645 saved ones do. A saved encounter is the whole
object rather than a reference to a blueprint, so there is nothing for
it to name.
x_position: f32X position (XPosition).
y_position: f32Y position (YPosition).
z_position: f32Z position (ZPosition).
Implementations§
Source§impl GitEncounter
impl GitEncounter
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 GitEncounter
impl Clone for GitEncounter
Source§fn clone(&self) -> GitEncounter
fn clone(&self) -> GitEncounter
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 GitEncounter
impl Debug for GitEncounter
Source§impl Default for GitEncounter
impl Default for GitEncounter
Source§impl HasSchema for GitEncounter
impl HasSchema for GitEncounter
Source§impl PartialEq for GitEncounter
impl PartialEq for GitEncounter
Source§fn eq(&self, other: &GitEncounter) -> bool
fn eq(&self, other: &GitEncounter) -> bool
self and other values to be equal, and is used by ==.