Struct cellular_maps::CellularMap
source · pub struct CellularMap { /* private fields */ }
Implementations§
source§impl CellularMap
impl CellularMap
sourcepub fn new(w: u32, h: u32) -> CellularMap
pub fn new(w: u32, h: u32) -> CellularMap
sourcepub fn get_width(self: &CellularMap) -> u32
pub fn get_width(self: &CellularMap) -> u32
Get the map width.
sourcepub fn get_height(self: &CellularMap) -> u32
pub fn get_height(self: &CellularMap) -> u32
Get the map height.
sourcepub fn get_element(self: &CellularMap, r: u32, c: u32) -> u8
pub fn get_element(self: &CellularMap, r: u32, c: u32) -> u8
Get the element in position <r,c>
.
sourcepub fn random_fill(self: &mut CellularMap, wall_prob: u32)
pub fn random_fill(self: &mut CellularMap, wall_prob: u32)
Initialize a random CellularMap
.
pub fn evolve_default(self: &mut CellularMap)
sourcepub fn evolve(self: &mut CellularMap, _strategy: EvolveStrategy)
pub fn evolve(self: &mut CellularMap, _strategy: EvolveStrategy)
Evolve the CellularMap
according the automata rules.