pub trait TerrainSource {
type Position;
type Terrain;
// Required methods
fn iter(
&self,
) -> impl Iterator<Item = NeededTerrain<Self::Position, Self::Terrain>>;
fn contains_position(&self, position: &Self::Position) -> bool;
}Expand description
Trait for objects that represent a particular autotiling problem to be solved, with a set of positions that need tiles and a terrain for each position to control which tiles are valid.
Required Associated Types§
Required Methods§
Sourcefn iter(
&self,
) -> impl Iterator<Item = NeededTerrain<Self::Position, Self::Terrain>>
fn iter( &self, ) -> impl Iterator<Item = NeededTerrain<Self::Position, Self::Terrain>>
Iterate over the positions that need tiles and the terrains at each position.
Sourcefn contains_position(&self, position: &Self::Position) -> bool
fn contains_position(&self, position: &Self::Position) -> bool
True if the given position needs to be tiled.
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.