Changed MiniYaml.NodesDict property into a method.
Method is now called ToDictionary. - Cached a few invocations into locals which should prevent some redundant evaluation. - Added ToDictionary overloads that take projection functions for the keys and elements, since several callsites were doing a subsequent Linq.ToDictionary call to get this.
This commit is contained in:
@@ -82,7 +82,7 @@ namespace OpenRA.TilesetBuilder
|
||||
int size = int.Parse(tsize);
|
||||
|
||||
var yaml = MiniYaml.DictFromFile("OpenRA.TilesetBuilder/defaults.yaml");
|
||||
terrainDefinition = yaml["Terrain"].NodesDict.Values.Select(y => new TerrainTypeInfo(y)).ToDictionary(t => t.Type);
|
||||
terrainDefinition = yaml["Terrain"].ToDictionary().Values.Select(y => new TerrainTypeInfo(y)).ToDictionary(t => t.Type);
|
||||
int i = 0;
|
||||
surface1.Icon = new Bitmap[terrainDefinition.Keys.Count];
|
||||
TerrainType = new TerrainTypeInfo[terrainDefinition.Keys.Count];
|
||||
|
||||
Reference in New Issue
Block a user