pub trait TilePattern {
type Offset;
type Diagonal;
// Required methods
fn is_legal(&self, offset: &Self::Offset, to: &Self) -> bool;
fn is_legal_diagonal(&self, offset: &Self::Diagonal, to: &Self) -> bool;
}Expand description
For the purposes of autotiling, tiles are represented by patterns that hold the data which determines whether two tiles are permitted to appear adjacent to each other. Therefore autotile algorithms place patterns rather than tiles, and translating those patterns into actual tiles is a later step.
Required Associated Types§
Required Methods§
Sourcefn is_legal(&self, offset: &Self::Offset, to: &Self) -> bool
fn is_legal(&self, offset: &Self::Offset, to: &Self) -> bool
True if this pattern may be adjacent the given other pattern of this type
when that other pattern is positioned at offset relative to this pattern.
Sourcefn is_legal_diagonal(&self, offset: &Self::Diagonal, to: &Self) -> bool
fn is_legal_diagonal(&self, offset: &Self::Diagonal, to: &Self) -> bool
True if this pattern may be diagonal to the given other pattern when
that other pattern is positioned at offset relative to this pattern.
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.