/// <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> ///Returns the height (in tiles) of the map /// </summary> /// <param name="map"> /// The map from which you wish to retrieve the height /// </param> /// <returns> /// The height of the map /// </returns> public static int GetMapHeight(BlockMap map) { return(map.GetMapHeight()); }
/// <summary> ///Returns the height (in tiles) of the map /// </summary> /// <param name="map"> /// The map from which you wish to retrieve the height /// </param> /// <returns> /// The height of the map /// </returns> public static int GetMapHeight(BlockMap map){ return map.GetMapHeight(); }
/// <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(); } } } } } }