use rand::{thread_rng, Rng};

#[derive(Debug, Copy, Clone)]
pub enum TerrainType {
	Water,
	Grass,
	TallGrass,
	Sand,
	Snow,
	Tundra
}

#[derive(Debug)]
pub struct Tile {
	typ:TerrainType,
	height:u16,
}

pub struct Terrain {
	data:Vec<Tile>,
}

impl Terrain {
	pub fn new(size:usize) -> Terrain {
		// create the terrain data
		let mut terrain = Terrain {
			data:Vec::with_capacity(size*size),
		};
		
		// fill up the terrain with random tiles
		let choices = [
			TerrainType::Water,
			TerrainType::Grass,
			TerrainType::TallGrass,
			TerrainType::Sand,
			TerrainType::Snow,
			TerrainType::Tundra
		];
		let mut rng = thread_rng();
		for n in 0..(size*size) {
			terrain.data.push(Tile { typ:*rng.choose(&choices).unwrap(), height:0 });
		}

		println!("Terrain: {:?}",terrain.data);

		terrain
	}
}
use rand::{thread_rng, Rng};

#[derive(Debug, Copy, Clone)]
pub enum TerrainType {
	Water,
	Grass,
	TallGrass,
	Sand,
	Snow,
	Tundra
}

#[derive(Debug)]
pub struct Tile {
	typ:TerrainType,
}

pub struct Terrain {
	data:Vec<Tile>,
}

impl Terrain {
	pub fn new(size:usize) -> Terrain {
		// create the terrain data
		let mut terrain = Terrain {
			data:Vec::with_capacity(size*size),
		};
		
		// fill up the terrain with random tiles
		let choices = [
			TerrainType::Water,
			TerrainType::Grass,
			TerrainType::TallGrass,
			TerrainType::Sand,
			TerrainType::Snow,
			TerrainType::Tundra
		];
		let mut rng = thread_rng();
		for n in 0..(size*size) {
			terrain.data.push(Tile { typ:*rng.choose(&choices).unwrap() });
		}

		println!("Terrain: {:?}",terrain.data);

		terrain
	}
}
--- 
+++ 
@@ -13,6 +13,7 @@
 #[derive(Debug)]
 pub struct Tile {
 	typ:TerrainType,
+	height:u16,
 }
 
 pub struct Terrain {
@@ -37,7 +38,7 @@
 		];
 		let mut rng = thread_rng();
 		for n in 0..(size*size) {
-			terrain.data.push(Tile { typ:*rng.choose(&choices).unwrap() });
+			terrain.data.push(Tile { typ:*rng.choose(&choices).unwrap(), height:0 });
 		}
 
 		println!("Terrain: {:?}",terrain.data);
Add height to the struct
