2 using Microsoft.Xna.Framework;
3 using System.Collections.Generic;
4 using System.Collections.Immutable;
16 get {
return Params.ActivePrefab; }
43 [
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)]
46 [
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)]
50 "Sites determine shape of the voronoi graph. Locations are placed at the vertices of the voronoi cells. " +
51 "(Decreasing this value causes the number of sites, and the complexity of the map, to increase exponentially - be careful when adjusting)"),
Editable]
63 [
Serialize(0.1f,
IsPropertySaveable.Yes, description:
"ConnectionIterationMultiplier for the UI indicator lines between locations."),
Editable(0.0f, 10.0f, DecimalCount = 2)]
66 [
Serialize(0.1f,
IsPropertySaveable.Yes, description:
"ConnectionDisplacementMultiplier for the UI indicator lines between locations."),
Editable(0.0f, 10.0f, DecimalCount = 2)]
112 public readonly ImmutableDictionary<Identifier, ImmutableArray<Sprite>>
MapTiles;
115 public string Name => GetType().ToString();
129 if (gateCount ==
null)
137 GateCount = gateCount.ToImmutableArray();
139 Dictionary<Identifier, List<Sprite>> mapTiles =
new Dictionary<Identifier, List<Sprite>>();
141 foreach (var subElement
in element.Elements())
143 switch (subElement.Name.ToString().ToLowerInvariant())
146 case "connectionsprite":
149 case "passedconnectionsprite":
153 Identifier biome = subElement.GetAttributeIdentifier(
"biome",
"");
154 if (!mapTiles.ContainsKey(biome))
156 mapTiles[biome] =
new List<Sprite>();
158 mapTiles[biome].Add(
new Sprite(subElement));
160 case "fogofwarsprite":
163 case "locationindicator":
164 case "currentlocationindicator":
167 case "selectedlocationindicator":
170 case "decorativegraphsprite":
176 case "typechangeicon":
180 case "radiationparams":
186 MapTiles = mapTiles.Select(kvp => (kvp.Key, kvp.Value.ToImmutableArray())).ToImmutableDictionary();
201 foreach (ImmutableArray<Sprite> spriteList
in MapTiles.Values)
203 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)