Struct AdvancementProgress
#[non_exhaustive]pub struct AdvancementProgress {
pub criteria: Vec<CriterionProgress>,
pub requirements: Vec<Vec<String>>,
pub completed_requirements: u32,
pub done: bool,
}Expand description
An owned, read-only snapshot of one advancement’s complete progress.
crate::PlayerAdvancementProgressEvent::progress captures this after the
criterion changes and before completion rewards. Retaining or changing a
clone does not change the player’s progress. The same representation can
describe progress outside an event without borrowing the game or a player.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.criteria: Vec<CriterionProgress>Every criterion in definition order, including unobtained criteria.
requirements: Vec<Vec<String>>Requirement groups: at least one criterion in each group must be obtained. All groups must be satisfied; an empty list is not complete.
completed_requirements: u32Number of requirement groups satisfied, not the number of obtained criteria.
done: boolWhether the owning progress considers this advancement complete.
Implementations§
§impl AdvancementProgress
impl AdvancementProgress
pub fn new(
criteria: Vec<CriterionProgress>,
requirements: Vec<Vec<String>>,
completed_requirements: u32,
done: bool,
) -> AdvancementProgress
pub fn new( criteria: Vec<CriterionProgress>, requirements: Vec<Vec<String>>, completed_requirements: u32, done: bool, ) -> AdvancementProgress
Build a snapshot from the owning progress’s criteria and requirement results.
Trait Implementations§
§impl Clone for AdvancementProgress
impl Clone for AdvancementProgress
§fn clone(&self) -> AdvancementProgress
fn clone(&self) -> AdvancementProgress
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more