pub struct SavedClass {
pub class_id: i32,
pub class_level: i16,
pub powers: Vec<u16>,
pub spells_per_day: Vec<u8>,
}Expand description
One entry of a saved creature’s ClassList.
Not shared with UtcClass: the four labels both carry
agree on every audited axis, but a saved creature declares
SpellsPerDayList’s own element where a UTC models nothing behind it, so
the sets differ and the types stay apart.
Fields§
§class_id: i32Class row (Class).
class_level: i16Level in this class (ClassLevel).
powers: Vec<u16>Known power ids from KnownList0 (Spell).
spells_per_day: Vec<u8>Remaining casts per level from SpellsPerDayList (NumSpellsLeft).
Every element carries 0x4567, a hand-picked marker rather than an
index, a count or anything derived from the element. What the engine
does with it is unexamined; what it writes is not in doubt.
Implementations§
Source§impl SavedClass
impl SavedClass
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.
Trait Implementations§
Source§impl Clone for SavedClass
impl Clone for SavedClass
Source§fn clone(&self) -> SavedClass
fn clone(&self) -> SavedClass
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 SavedClass
impl Debug for SavedClass
Source§impl Default for SavedClass
impl Default for SavedClass
Source§impl HasSchema for SavedClass
impl HasSchema for SavedClass
Source§impl PartialEq for SavedClass
impl PartialEq for SavedClass
Source§fn eq(&self, other: &SavedClass) -> bool
fn eq(&self, other: &SavedClass) -> bool
self and other values to be equal, and is used by ==.