pub fn plant (width : usize, height : usize, tiles: &mut Vec<TileType>, number_generator: &mut StdRng, flora_type: TileType, floor : TileType, density: i32) {
	use super::map::tile::small_foliage_variant;
	info!("Planting...");

	let small_variant = small_foliage_variant(flora_type);

	for x in 1..width-1 {
		for y in 1..height-1 {
			let idx = x+y*width;
			if tiles[idx] == floor {
				let chance = number_generator.gen_range(0, 100);
				if chance < density {
					tiles[idx] = small_variant;
				}
			}
		}
	}
}
/// Like `random_fill` but places a type of foliage on `TileType::Floor` according to a given density.
/// Panics if the given type is not foliage.
Like `random_fill` but places a type of foliage on `TileType::Floor` according to a given density.
Panics if the given type is not foliage.
Like ` random_fill ` but places a type of foliage on ` TileType :: Floor ` according to a given density . Panics if the given type is not foliage .
pub fn plant (width : usize, height : usize, tiles: &mut Vec<TileType>, number_generator: &mut StdRng, flora_type: TileType, floor : TileType, density: i32) {
	use super::map::tile::small_foliage_variant;
	info!("Planting...");
	let small_variant = small_foliage_variant(flora_type);
	for x in 1..width-1 {
		for y in 1..height-1 {
			let idx = x+y*width;
			if tiles[idx] == floor {
				let chance = number_generator.gen_range(0, 100);
				if chance < density {
					tiles[idx] = small_variant;
				}
			}
		}
	}
}
pub fn plant ( width : usize , height : usize , tiles : & mut Vec < TileType > , number_generator : & mut StdRng , flora_type : TileType , floor : TileType , density : i32 ) { use super :: map :: tile :: small_foliage_variant ; info ! ( " " ) ; let small_variant = small_foliage_variant ( flora_type ) ; for x in 1 .. width - 1 { for y in 1 .. height - 1 { let idx = x + y * width ; if tiles [ idx ] == floor { let chance = number_generator . gen_range ( 0 , 100 ) ; if chance < density { tiles [ idx ] = small_variant ; } } } } }
Like `random_fill` but places a type of foliage on `TileType::Floor` according to a given density.
Like ` random_fill ` but places a type of foliage on ` TileType :: Floor ` according to a given density .
width
usize
height
usize
tiles
&mut Vec<TileType>
number_generator
&mut StdRng
flora_type
TileType
floor
TileType
density
i32
width
usize
height
usize
tiles
&mut Vec<TileType>
number_generator
&mut StdRng
flora_type
TileType
floor
TileType
density
i32