pub struct FacFaction {
pub name: String,
pub parent_id: u32,
pub global: bool,
}Expand description
One faction from the FactionList.
The faction’s own id is its position in the list and is not stored on the element.
Fields§
§name: StringDisplay/lookup name (FactionName).
parent_id: u32Parent faction id (FactionParentID).
Kept as a raw id. Every one of the factions in all four committed save
fixtures carries 0xFFFFFFFF, which looks like a no-parent sentinel,
but that reading has not been confirmed against the binary and the
engine audit does not record a meaning for it. Modelling this as an
absent parent would encode the guess; widening to an Option later
costs nothing if an audit confirms it.
global: boolWhether this is one of the standard shared factions (FactionGlobal).
Absent on load means true. The file holds it as a WORD, which is
the one case the declared Rust type does not settle the encoding.
Implementations§
Source§impl FacFaction
impl FacFaction
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 FacFaction
impl Clone for FacFaction
Source§fn clone(&self) -> FacFaction
fn clone(&self) -> FacFaction
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 FacFaction
impl Debug for FacFaction
Source§impl Default for FacFaction
impl Default for FacFaction
Source§impl HasSchema for FacFaction
impl HasSchema for FacFaction
Source§impl PartialEq for FacFaction
impl PartialEq for FacFaction
Source§fn eq(&self, other: &FacFaction) -> bool
fn eq(&self, other: &FacFaction) -> bool
self and other values to be equal, and is used by ==.