pub struct Git {Show 15 fields
pub area_map: Option<GitAreaMap>,
pub current_weather: u8,
pub weather_started: bool,
pub waypoints: Vec<GitWaypoint>,
pub encounters: Vec<GitEncounter>,
pub area_effects: Vec<GitAreaEffect>,
pub area_properties: Option<GitAreaProperties>,
pub cameras: Vec<GitCamera>,
pub creatures: GitCreatures,
pub items: GitItems,
pub doors: GitDoors,
pub placeables: GitPlaceables,
pub sounds: GitSounds,
pub triggers: GitTriggers,
pub stores: GitStores,
}Expand description
Typed GIT model built from/to Gff data.
GIT is the area instance container. It places object instances by referencing templates and providing position/orientation data. All engine-read fields are typed; roundtrip is fully lossless for typed fields.
Fields§
§area_map: Option<GitAreaMap>The explored-map bitmap (AreaMap), declared and not modelled.
Save-only. AreaMapData appears in every save fixture and in no
module GIT the install ships, so writing the block unconditionally
would put an explored map on an area nobody has walked.
current_weather: u8Current weather (CurrentWeather). If area is an interior, engine forcibly overrides to 0xFF.
weather_started: boolWeather started flag (WeatherStarted). If area is an interior, engine forcibly overrides to 0 (false).
waypoints: Vec<GitWaypoint>Waypoint instances (WaypointList).
encounters: Vec<GitEncounter>Encounter instances (Encounter List).
Read as static placements whatever UseTemplates says, which is
wrong for a savegame GIT: a saved encounter comes back with an
empty TemplateResRef rather than its spawned state. Encounters are
the one object list still in that position. They are held back
because there is nothing to model them against: every save in
fixtures/saves/ has an empty Encounter List, and unlike area
effects the engine’s saved encounter field set is not written down in
docs/src/formats/gff/git.md either. Modelling it from LoadEncounters
alone would ship a field set with no way to check it.
area_effects: Vec<GitAreaEffect>Area-of-effect instances (AreaEffectList).
area_properties: Option<GitAreaProperties>Area-level properties (AreaProperties).
cameras: Vec<GitCamera>Static cameras (CameraList). Engine load failure occurs if array contains 51 or more entries.
creatures: GitCreaturesCreature List instances, in whichever form the file uses.
items: GitItemsList instances, in whichever form the file uses.
doors: GitDoorsDoor List instances, in whichever form the file uses.
placeables: GitPlaceablesPlaceable List instances, in whichever form the file uses.
sounds: GitSoundsSoundList instances, in whichever form the file uses.
triggers: GitTriggersTriggerList instances, in whichever form the file uses.
stores: GitStoresStoreList instances, in whichever form the file uses.
Implementations§
Source§impl Git
impl Git
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.