Example #1
0
        /// <summary>
        ///Refresh the map - correcting orientations on all blocks
        /// </summary>
        /// <param name="map">
        /// The map that you wish to refresh
        /// </param>
        /// <param name="randomise">
        /// Randomise the block variations within the map?
        /// </param>
        public static void RefreshMap(BlockMap map, bool randomise)
        {
            map.RefreshMap();

            if (randomise)
            {
                for (int x = 0; x < map.GetMapWidth(); x++)
                {
                    for (int y = 0; y < map.GetMapHeight(); y++)
                    {
                        for (int z = map.mapLowerDepth; z <= map.mapUpperDepth; z++)
                        {
                            Block b = map.GetBlockAt(x, y, z);
                            if (b != null && !b.isNullBlock)
                            {
                                b.RandomiseVariant();
                            }
                        }
                    }
                }
            }
        }
		/// <summary>
		///Refresh the map - correcting orientations on all blocks 
		/// </summary>
		/// <param name="map">
		/// The map that you wish to refresh
		/// </param>
		/// <param name="randomise">
		/// Randomise the block variations within the map?
		/// </param>
		public static void RefreshMap(BlockMap map, bool randomise){
			map.RefreshMap();
			
			if(randomise){
				for(int x = 0; x < map.GetMapWidth(); x++){
					for(int y = 0; y < map.GetMapHeight(); y++){
						for(int z = map.mapLowerDepth; z <= map.mapUpperDepth; z++){
							Block b = map.GetBlockAt(x,y,z);
							if(b != null && !b.isNullBlock){
								b.RandomiseVariant();
							}
						}
					}
				}
			}
		}