fCraft.MapGenUtil.SaveToMap C# (CSharp) Method

SaveToMap() public static method

Embeds given map generation parameters in a map file.
mapGenParams or map is null.
public static SaveToMap ( [ mapGenParams, [ map ) : void
mapGenParams [ Parameters to embed.
map [ Map to embed parameters in.
return void
        public static void SaveToMap( [NotNull] this MapGeneratorParameters mapGenParams, [NotNull] Map map ) {
            if( mapGenParams == null ) {
                throw new ArgumentNullException( "mapGenParams" );
            }
            if( map == null ) {
                throw new ArgumentNullException( "map" );
            }
            XElement el = new XElement( ParamsMetaKey );
            mapGenParams.Save( el );
            map.Metadata[ParamsMetaGroup, ParamsMetaKey] = el.ToString( SaveOptions.DisableFormatting );
            map.Metadata[ParamsMetaGroup, GenNameMetaKey] = mapGenParams.Generator.Name;
            map.Metadata[ParamsMetaGroup, GenVersionMetaKey] = mapGenParams.Generator.Version.ToString();
        }