pub struct UtiProjection<'a> { /* private fields */ }Expand description
File-native projection of a Uti.
Each UtiProperty is routed to a typed DecodedProperty
variant by matching on the itempropdef.2da label value at
projection time. No further 2DA resolution happens at this stage;
the projection is the cheap, scope-free intermediate from which
one or more UtiSnapshots are built.
Construct via Uti::project. Multiple snapshots from one
projection share typed-variant dispatch but each captures its own
per-scope resolved data (baseitems cells, cost-table magnitudes,
etc.). This is the projection-stage type referenced by the
“typed views are honest projections” rule: file-native dispatch
only, never resolved cross-resource data.
Implementations§
Source§impl<'a> UtiProjection<'a>
impl<'a> UtiProjection<'a>
Sourcepub fn properties(&self) -> &[DecodedProperty]
pub fn properties(&self) -> &[DecodedProperty]
Returns the typed-variant decoded properties as a borrowed slice.
The order matches the source Uti::properties ordering;
callers that need a particular property look it up by index
or filter the slice.
Sourcepub fn is_armor(&self) -> bool
pub fn is_armor(&self) -> bool
Returns true when the source UTI’s BaseItem belongs to
the canonical armor base-item set.
Pure delegation to Uti::is_armor – the underlying check
is a const lookup against the hardcoded armor base-item id
set and needs no 2DA cache. Re-exposed here so callers that
only hold a UtiProjection do not have to reach back to
the source Uti.
Sourcepub fn snapshot(&self, cache: &mut TwoDaCache<'_>) -> UtiSnapshot<'a>
pub fn snapshot(&self, cache: &mut TwoDaCache<'_>) -> UtiSnapshot<'a>
Resolves this projection against the given context, building
a UtiSnapshot whose query methods read from a cached
resolution of every table the snapshot will be asked about.
Multiple snapshots can be built from one projection, each capturing its own per-scope resolved data. The projection itself is unchanged and remains reusable across calls.
Trait Implementations§
Source§impl<'a> Clone for UtiProjection<'a>
impl<'a> Clone for UtiProjection<'a>
Source§fn clone(&self) -> UtiProjection<'a>
fn clone(&self) -> UtiProjection<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more