pub fn clean_up_regions (width : usize, height : usize, tiles : &mut Vec<TileType>, t : TileType, r : TileType, size_threshold: usize) {
	info!("Cleaning...");
	let mut wall_regions = get_all_regions(width, height, t, tiles);

	let mut excluded_regions : Vec<Region> = Vec::new();

	//exclude bad wall regions
	for i in (0..wall_regions.len()).rev() {
		if wall_regions[i].tiles.len() <= size_threshold {
			excluded_regions.push(wall_regions.remove(i));
		}
	}

	debug!("{} excluded regions;", excluded_regions.len());

	for region in excluded_regions {
		for tile in region.tiles {
			let x = tile.0 as usize;
			let y = tile.1 as usize;

			tiles[x+y*width] = r;
		}
	}
}
///Removes wall or floor regions that don't meet size requirements.
Removes wall or floor regions that don't meet size requirements.
Removes wall or floor regions that don ' t meet size requirements .
pub fn clean_up_regions (width : usize, height : usize, tiles : &mut Vec<TileType>, t : TileType, r : TileType, size_threshold: usize) {
	info!("Cleaning...");
	let mut wall_regions = get_all_regions(width, height, t, tiles);
	let mut excluded_regions : Vec<Region> = Vec::new();
	//exclude bad wall regions
	for i in (0..wall_regions.len()).rev() {
		if wall_regions[i].tiles.len() <= size_threshold {
			excluded_regions.push(wall_regions.remove(i));
		}
	}
	debug!("{} excluded regions;", excluded_regions.len());
	for region in excluded_regions {
		for tile in region.tiles {
			let x = tile.0 as usize;
			let y = tile.1 as usize;
			tiles[x+y*width] = r;
		}
	}
}
pub fn clean_up_regions ( width : usize , height : usize , tiles : & mut Vec < TileType > , t : TileType , r : TileType , size_threshold : usize ) { info ! ( " " ) ; let mut wall_regions = get_all_regions ( width , height , t , tiles ) ; let mut excluded_regions : Vec < Region > = Vec :: new ( ) ; //exclude bad wall regions for i in ( 0 .. wall_regions . len ( ) ) . rev ( ) { if wall_regions [ i ] . tiles . len ( ) <= size_threshold { excluded_regions . push ( wall_regions . remove ( i ) ) ; } } debug ! ( " " excluded_regions len ( ) ) ; for region in excluded_regions { for tile in region . tiles { let x = tile . 0 as usize ; let y = tile . 1 as usize ; tiles [ x + y * width ] = r ; } } }
Removes wall or floor regions that don't meet size requirements.
Removes wall or floor regions that don ' t meet size requirements .
width
usize
height
usize
tiles
&mut Vec<TileType>
t
TileType
r
TileType
size_threshold
usize
width
usize
height
usize
tiles
&mut Vec<TileType>
t
TileType
r
TileType
size_threshold
usize