Struct cellular_maps::CellularMap
[−]
[src]
pub struct CellularMap { /* fields omitted */ }
Methods
impl CellularMap
[src]
fn new(w: u32, h: u32) -> CellularMap
Create a new CellularMap
instance.
Arguments
w
- The desired map width.h
- The desired map height.
Example
use cellular_maps::CellularMap; // Create a 30x30 celular map. let mut cm = CellularMap::new(30,30);
fn get_width(self: &CellularMap) -> u32
Get the map width.
fn get_height(self: &CellularMap) -> u32
Get the map height.
fn get_element(self: &CellularMap, r: u32, c: u32) -> u8
Get the element in position <r,c>
.
fn random_fill(self: &mut CellularMap, wall_prob: u32)
Initialize a random CellularMap
.
fn evolve_default(self: &mut CellularMap)
fn evolve(self: &mut CellularMap, strategy: EvolveStrategy)
Evolve the CellularMap
according the automata rules.