2 using Microsoft.Xna.Framework;
3 using System.Collections.Generic;
4 using System.Collections.Immutable;
17 return Params.ActivePrefab;
45 [
Serialize(20.0f,
IsPropertySaveable.Yes, description:
"Connections with a length smaller or equal to this generate the smallest possible levels (using the MinWidth parameter in the level generation paramaters)."),
Editable(0.0f, 5000.0f)]
48 [
Serialize(200.0f,
IsPropertySaveable.Yes, description:
"Connections with a length larger or equal to this generate the largest possible levels (using the MaxWidth parameter in the level generation paramaters)."),
Editable(0.0f, 5000.0f)]
52 "Sites determine shape of the voronoi graph. Locations are placed at the vertices of the voronoi cells. " +
53 "(Decreasing this value causes the number of sites, and the complexity of the map, to increase exponentially - be careful when adjusting)"),
Editable]
65 [
Serialize(0.1f,
IsPropertySaveable.Yes, description:
"ConnectionIterationMultiplier for the UI indicator lines between locations."),
Editable(0.0f, 10.0f, DecimalCount = 2)]
68 [
Serialize(0.1f,
IsPropertySaveable.Yes, description:
"ConnectionDisplacementMultiplier for the UI indicator lines between locations."),
Editable(0.0f, 10.0f, DecimalCount = 2)]
114 public readonly ImmutableDictionary<Identifier, ImmutableArray<Sprite>>
MapTiles;
117 public string Name => GetType().ToString();
131 if (gateCount ==
null)
139 GateCount = gateCount.ToImmutableArray();
141 Dictionary<Identifier, List<Sprite>> mapTiles =
new Dictionary<Identifier, List<Sprite>>();
143 foreach (var subElement
in element.Elements())
145 switch (subElement.Name.ToString().ToLowerInvariant())
148 case "connectionsprite":
151 case "passedconnectionsprite":
155 Identifier biome = subElement.GetAttributeIdentifier(
"biome",
"");
156 if (!mapTiles.ContainsKey(biome))
158 mapTiles[biome] =
new List<Sprite>();
160 mapTiles[biome].Add(
new Sprite(subElement));
162 case "fogofwarsprite":
165 case "locationindicator":
166 case "currentlocationindicator":
169 case "selectedlocationindicator":
172 case "decorativegraphsprite":
178 case "typechangeicon":
182 case "radiationparams":
188 MapTiles = mapTiles.Select(kvp => (kvp.Key, kvp.Value.ToImmutableArray())).ToImmutableDictionary();
203 foreach (ImmutableArray<Sprite> spriteList
in MapTiles.Values)
205 foreach (
Sprite sprite
in spriteList)
int?[] GetAttributeIntArray(string key, int[]? def)
readonly ImmutableDictionary< Identifier, ImmutableArray< Sprite > > MapTiles
Sprite CurrentLocationIndicator
RadiationParams RadiationParams
float LocationConnectionWidth
static readonly PrefabSelector< MapGenerationParams > Params
Color UnvisitedConnectionColor
readonly bool ShowLevelTypeNames
Dictionary< Identifier, SerializableProperty > SerializableProperties
readonly bool ShowLocations
float SmallLevelConnectionLength
SpriteSheet DecorativeGraphSprite
float ConnectionIndicatorDisplacementMultiplier
Sprite SelectedLocationIndicator
static MapGenerationParams Instance
MapGenerationParams(ContentXElement element, MapGenerationParametersFile file)
Sprite PassedConnectionSprite
float LargeLevelConnectionLength
Point VoronoiSiteVariance
float ConnectionIndicatorIterationMultiplier
float MinLocationDistance
Point VoronoiSiteInterval
float MinConnectionDistance
readonly bool ShowOverlay
Color HighlightedConnectionColor
readonly ImmutableArray< int > GateCount
readonly Identifier Identifier
static Dictionary< Identifier, SerializableProperty > DeserializeProperties(object obj, XElement element=null)