本文整理汇总了C#中OpenRA.FileFormats.MiniYaml.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# MiniYaml.ContainsKey方法的具体用法?C# MiniYaml.ContainsKey怎么用?C# MiniYaml.ContainsKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenRA.FileFormats.MiniYaml
的用法示例。
在下文中一共展示了MiniYaml.ContainsKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Manifest
public Manifest(string mod)
{
var path = new[] { "mods", mod, "mod.yaml" }.Aggregate(Path.Combine);
var yaml = new MiniYaml(null, MiniYaml.FromFile(path)).NodesDict;
Mod = FieldLoader.Load<Mod>(yaml["Metadata"]);
Mod.Id = mod;
// TODO: Use fieldloader
Folders = YamlList(yaml, "Folders");
MapFolders = YamlList(yaml, "MapFolders");
Packages = yaml["Packages"].NodesDict.ToDictionary(x => x.Key, x => x.Value.Value);
Rules = YamlList(yaml, "Rules");
ServerTraits = YamlList(yaml, "ServerTraits");
Sequences = YamlList(yaml, "Sequences");
VoxelSequences = YamlList(yaml, "VoxelSequences");
Cursors = YamlList(yaml, "Cursors");
Chrome = YamlList(yaml, "Chrome");
Assemblies = YamlList(yaml, "Assemblies");
ChromeLayout = YamlList(yaml, "ChromeLayout");
Weapons = YamlList(yaml, "Weapons");
Voices = YamlList(yaml, "Voices");
Notifications = YamlList(yaml, "Notifications");
Music = YamlList(yaml, "Music");
Movies = YamlList(yaml, "Movies");
Translations = YamlList(yaml, "Translations");
TileSets = YamlList(yaml, "TileSets");
ChromeMetrics = YamlList(yaml, "ChromeMetrics");
PackageContents = YamlList(yaml, "PackageContents");
LuaScripts = YamlList(yaml, "LuaScripts");
LoadScreen = yaml["LoadScreen"];
LobbyDefaults = yaml["LobbyDefaults"];
Fonts = yaml["Fonts"].NodesDict.ToDictionary(x => x.Key,
x => Pair.New(x.Value.NodesDict["Font"].Value,
int.Parse(x.Value.NodesDict["Size"].Value)));
if (yaml.ContainsKey("TileSize"))
TileSize = int.Parse(yaml["TileSize"].Value);
// Allow inherited mods to import parent maps.
var compat = new List<string>();
compat.Add(mod);
if (yaml.ContainsKey("SupportsMapsFrom"))
foreach (var c in yaml["SupportsMapsFrom"].Value.Split(','))
compat.Add(c.Trim());
MapCompatibility = compat.ToArray();
}
示例2: Manifest
public Manifest(string[] mods)
{
Mods = mods;
var yaml = new MiniYaml(null, mods
.Select(m => MiniYaml.FromFile("mods/" + m + "/mod.yaml"))
.Aggregate(MiniYaml.MergeLiberal)).NodesDict;
// TODO: Use fieldloader
Folders = YamlList(yaml, "Folders");
Packages = YamlList(yaml, "Packages");
Rules = YamlList(yaml, "Rules");
ServerTraits = YamlList(yaml, "ServerTraits");
Sequences = YamlList(yaml, "Sequences");
Cursors = YamlList(yaml, "Cursors");
Chrome = YamlList(yaml, "Chrome");
Assemblies = YamlList(yaml, "Assemblies");
ChromeLayout = YamlList(yaml, "ChromeLayout");
Weapons = YamlList(yaml, "Weapons");
Voices = YamlList(yaml, "Voices");
Notifications = YamlList(yaml, "Notifications");
Music = YamlList(yaml, "Music");
Movies = YamlList(yaml, "Movies");
TileSets = YamlList(yaml, "TileSets");
ChromeMetrics = YamlList(yaml, "ChromeMetrics");
LoadScreen = yaml["LoadScreen"];
Fonts = yaml["Fonts"].NodesDict.ToDictionary(x => x.Key,
x => Pair.New(x.Value.NodesDict["Font"].Value,
int.Parse(x.Value.NodesDict["Size"].Value)));
if (yaml.ContainsKey("TileSize"))
TileSize = int.Parse(yaml["TileSize"].Value);
}