Skip to main content

TerrainSource

Trait TerrainSource 

Source
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§

Source

type Position

The type of positions that need tiles.

Source

type Terrain

The type of the terrains that control which patterns are allowed at each position.

Required Methods§

Source

fn iter( &self, ) -> impl Iterator<Item = NeededTerrain<Self::Position, Self::Terrain>>

Iterate over the positions that need tiles and the terrains at each position.

Source

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.

Implementors§