pub fn is_edge_tile (width: usize, height : usize, x: i32, y: i32, tiles : &mut Vec<TileType>) -> bool {
	for dx in (x - 1)..(x + 2) {
		for dy in (y-1)..(y+2) {
			if (dx <= 0 || dx >= width as i32) || (dy <= 0 || dy >= height as i32) {
				return true;
			} else {
				let idx = dx as usize + dy as usize * width;
				if tiles[x as usize+y as usize*width] != tiles[idx] {
					return true
				} else {
					continue;
				}
			}

		}
	}
	return false;
}
/// Returns true of the given coordates are of a tile on the edge of a region.
Returns true of the given coordates are of a tile on the edge of a region.
Returns true of the given coordates are of a tile on the edge of a region .
pub fn is_edge_tile (width: usize, height : usize, x: i32, y: i32, tiles : &mut Vec<TileType>) -> bool {
	for dx in (x - 1)..(x + 2) {
		for dy in (y-1)..(y+2) {
			if (dx <= 0 || dx >= width as i32) || (dy <= 0 || dy >= height as i32) {
				return true;
			} else {
				let idx = dx as usize + dy as usize * width;
				if tiles[x as usize+y as usize*width] != tiles[idx] {
					return true
				} else {
					continue;
				}
			}
		}
	}
	return false;
}
pub fn is_edge_tile ( width : usize , height : usize , x : i32 , y : i32 , tiles : & mut Vec < TileType > ) -> bool { for dx in ( x - 1 ) .. ( x + 2 ) { for dy in ( y - 1 ) .. ( y + 2 ) { if ( dx <= 0 || dx >= width as i32 ) || ( dy <= 0 || dy >= height as i32 ) { return true ; } else { let idx = dx as usize + dy as usize * width ; if tiles [ x as usize + y as usize * width ] != tiles [ idx ] { return true } else { continue ; } } } } return false ; }
Returns true of the given coordates are of a tile on the edge of a region.
Returns true of the given coordates are of a tile on the edge of a region .
width
usize
height
usize
x
i32
y
i32
tiles
&mut Vec<TileType>
width
usize
height
usize
x
i32
y
i32
tiles
&mut Vec<TileType>