pub trait WaveOffsetCounter: Default + Clone {
type Offset;
// Required methods
fn count(&self, offset: &Self::Offset) -> usize;
fn count_mut(&mut self, offset: &Self::Offset) -> &mut usize;
}Expand description
A trait for counting types that store a usize for each of the offsets from
some OffsetPosition type. During the wave function collapse process, these
counts can be reduced as adjacent patterns possibilities are removed so
that the algorithm can keep track of how many ways a pattern is possible.
For a pattern to be possible, it must match some possible pattern in all
offsets, so if any of these counts become 0 the algorithm will know to
remove the corresponding pattern.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.