Skip to main content

Algorithm

Trait Algorithm 

Source
pub trait Algorithm<C: Cell = Tile> {
    // Required methods
    fn generate(&self, grid: &mut Grid<C>, seed: u64);
    fn name(&self) -> &'static str;
}
Expand description

Trait for procedural generation algorithms

Required Methods§

Source

fn generate(&self, grid: &mut Grid<C>, seed: u64)

Generate content into the grid using the given seed

Source

fn name(&self) -> &'static str

Algorithm name for identification

Trait Implementations§

Source§

impl<C: Cell> Algorithm<C> for Box<dyn Algorithm<C>>

Source§

fn generate(&self, grid: &mut Grid<C>, seed: u64)

Generate content into the grid using the given seed
Source§

fn name(&self) -> &'static str

Algorithm name for identification

Implementations on Foreign Types§

Source§

impl<C: Cell> Algorithm<C> for Box<dyn Algorithm<C>>

Source§

fn generate(&self, grid: &mut Grid<C>, seed: u64)

Source§

fn name(&self) -> &'static str

Implementors§