pub trait Algorithm<C: Cell = Tile>: Send + Sync {
// Required methods
fn generate(&self, grid: &mut Grid<C>, seed: u64);
fn name(&self) -> &'static str;
}Expand description
Trait for procedural generation algorithms.
All implementations must be Send + Sync so algorithms can be shared
across threads (e.g. in a Pipeline or thread pool).
§Examples
use terrain_forge::{Grid, Algorithm};
use terrain_forge::algorithms::Bsp;
let mut grid = Grid::new(40, 30);
let algo = Bsp::default();
algo.generate(&mut grid, 42);
assert!(grid.count(|t| t.is_floor()) > 0);