Stylecop clean Manifest.

This commit is contained in:
Paul Chote
2013-11-15 09:20:53 +13:00
parent a08dbdba05
commit d6f1debe22

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,
@@ -14,8 +14,7 @@ using System.Linq;
namespace OpenRA.FileFormats namespace OpenRA.FileFormats
{ {
/* describes what is to be loaded in order to run a set of mods */ // Describes what is to be loaded in order to run a mod
public class Manifest public class Manifest
{ {
public readonly Mod Mod; public readonly Mod Mod;
@@ -28,12 +27,12 @@ namespace OpenRA.FileFormats
public readonly Dictionary<string, string> Packages; public readonly Dictionary<string, string> Packages;
public readonly MiniYaml LoadScreen; public readonly MiniYaml LoadScreen;
public readonly MiniYaml LobbyDefaults; public readonly MiniYaml LobbyDefaults;
public readonly Dictionary<string, Pair<string,int>> Fonts; public readonly Dictionary<string, Pair<string, int>> Fonts;
public readonly int TileSize = 24; public readonly int TileSize = 24;
public Manifest(string mod) public Manifest(string mod)
{ {
var path = new [] { "mods", mod, "mod.yaml" }.Aggregate(Path.Combine); var path = new[] { "mods", mod, "mod.yaml" }.Aggregate(Path.Combine);
var yaml = new MiniYaml(null, MiniYaml.FromFile(path)).NodesDict; var yaml = new MiniYaml(null, MiniYaml.FromFile(path)).NodesDict;
Mod = FieldLoader.Load<Mod>(yaml["Metadata"]); Mod = FieldLoader.Load<Mod>(yaml["Metadata"]);
@@ -74,7 +73,7 @@ namespace OpenRA.FileFormats
static string[] YamlList(Dictionary<string, MiniYaml> yaml, string key) static string[] YamlList(Dictionary<string, MiniYaml> yaml, string key)
{ {
if (!yaml.ContainsKey(key)) if (!yaml.ContainsKey(key))
return new string[] {}; return new string[] { };
return yaml[key].NodesDict.Keys.ToArray(); return yaml[key].NodesDict.Keys.ToArray();
} }