public static MapGeneratorState MakeFlatgrass(int width, int length, int height) { MapGeneratorParameters preset = Instance.CreateDefaultParameters(); preset.MapWidth = width; preset.MapLength = length; preset.MapHeight = height; return(preset.CreateGenerator()); }
/// <summary> Embeds given map generation parameters in a map file. </summary> /// <param name="mapGenParams"> Parameters to embed. </param> /// <param name="map"> Map to embed parameters in. </param> /// <exception cref="ArgumentNullException"> mapGenParams or map is null. </exception> 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(); }
public EmptyMapGenState(MapGeneratorParameters genParams) { Parameters = genParams; }
public EmptyMapGenState( MapGeneratorParameters genParams ) { Parameters = genParams; }