pub enum SavedPortrait {
ResRef(ResRef),
Id(u16),
}Expand description
A saved object’s portrait, as whichever of the two labels it carries.
Across every placeable and trigger in the fixture saves the two are
exactly complementary: never both on one object, and never neither.
Modelling them as one value rather than two Options means the state
where an object claims both, or claims neither, cannot be built.
Variants§
ResRef(ResRef)
Portrait: a resref naming the portrait image.
Id(u16)
PortraitId: a row index into portraits.2da.
Trait Implementations§
Source§impl Clone for SavedPortrait
impl Clone for SavedPortrait
Source§fn clone(&self) -> SavedPortrait
fn clone(&self) -> SavedPortrait
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 SavedPortrait
impl Debug for SavedPortrait
Source§impl Default for SavedPortrait
impl Default for SavedPortrait
Source§fn default() -> Self
fn default() -> Self
The PortraitId sentinel the engine stamps when the field is absent.
0xFFFF fails the engine’s < 0xFFFE check, so it goes on to the
Portrait resref instead of looking up a row. The sentinel is kept
rather than resolved to the empty resref it eventually reaches: what
the engine’s member holds is 0xFFFF, and which branch that selects
is resolution, which a typed view does not run.
Source§impl PartialEq for SavedPortrait
impl PartialEq for SavedPortrait
Source§fn eq(&self, other: &SavedPortrait) -> bool
fn eq(&self, other: &SavedPortrait) -> bool
self and other values to be equal, and is used by ==.