pub trait PatternSource {
type Position;
type Terrain;
type Pattern;
// Required methods
fn get(
&self,
position: &Self::Position,
) -> TileConstraint<Self::Terrain, Self::Pattern> ⓘ;
fn get_terrain(&self, position: &Self::Position) -> Option<Self::Terrain>;
}Expand description
Trait for objects that represent a constraining environment for the autotiler.
Given any position, a PatternSource object can supply a TileConstraint for that position.
While a TerrainSource object alone may be enough to tell the autotiler what positions it needs
to fill with tiles, a PatternSource can provide information about the neighboring tiles, and thus
give the autotiler a complete picture of the environment it is tiling.
Required Associated Types§
Required Methods§
Sourcefn get(
&self,
position: &Self::Position,
) -> TileConstraint<Self::Terrain, Self::Pattern> ⓘ
fn get( &self, position: &Self::Position, ) -> TileConstraint<Self::Terrain, Self::Pattern> ⓘ
The contraint for the cell at the given position.
Sourcefn get_terrain(&self, position: &Self::Position) -> Option<Self::Terrain>
fn get_terrain(&self, position: &Self::Position) -> Option<Self::Terrain>
The terrain of the pattern at the given position.