.Any(), .Count() -> .Count or .Length
This commit is contained in:
committed by
atlimit8
parent
6eb4fe8980
commit
79f321cb44
@@ -108,7 +108,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
var mi = property.Item2;
|
||||
var required = property.Item3;
|
||||
var hasDesc = mi.HasAttribute<DescAttribute>();
|
||||
var hasRequires = required.Any();
|
||||
var hasRequires = required.Length > 0;
|
||||
var isActivity = mi.HasAttribute<ScriptActorPropertyActivityAttribute>();
|
||||
|
||||
Console.Write($"| **{mi.LuaDocString()}**");
|
||||
@@ -157,7 +157,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
var mi = property.Item2;
|
||||
var required = property.Item3;
|
||||
var hasDesc = mi.HasAttribute<DescAttribute>();
|
||||
var hasRequires = required.Any();
|
||||
var hasRequires = required.Length > 0;
|
||||
var isActivity = mi.HasAttribute<ScriptActorPropertyActivityAttribute>();
|
||||
|
||||
Console.Write($"| **{mi.LuaDocString()}**");
|
||||
|
||||
@@ -201,7 +201,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
}
|
||||
}
|
||||
|
||||
if (videos.Any())
|
||||
if (videos.Count > 0)
|
||||
{
|
||||
var worldNode = Map.RuleDefinitions.Nodes.FirstOrDefault(n => n.Key == "World");
|
||||
if (worldNode == null)
|
||||
@@ -311,21 +311,21 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
if (worldNode == null)
|
||||
worldNode = new MiniYamlNode("World", new MiniYaml("", new List<MiniYamlNode>()));
|
||||
|
||||
if (scorches.Any())
|
||||
if (scorches.Count > 0)
|
||||
{
|
||||
var initialScorches = new MiniYamlNode("InitialSmudges", new MiniYaml("", scorches));
|
||||
var smudgeLayer = new MiniYamlNode("SmudgeLayer@SCORCH", new MiniYaml("", new List<MiniYamlNode>() { initialScorches }));
|
||||
worldNode.Value.Nodes.Add(smudgeLayer);
|
||||
}
|
||||
|
||||
if (craters.Any())
|
||||
if (craters.Count > 0)
|
||||
{
|
||||
var initialCraters = new MiniYamlNode("InitialSmudges", new MiniYaml("", craters));
|
||||
var smudgeLayer = new MiniYamlNode("SmudgeLayer@CRATER", new MiniYaml("", new List<MiniYamlNode>() { initialCraters }));
|
||||
worldNode.Value.Nodes.Add(smudgeLayer);
|
||||
}
|
||||
|
||||
if (worldNode.Value.Nodes.Any() && !Map.RuleDefinitions.Nodes.Contains(worldNode))
|
||||
if (worldNode.Value.Nodes.Count > 0 && !Map.RuleDefinitions.Nodes.Contains(worldNode))
|
||||
Map.RuleDefinitions.Nodes.Add(worldNode);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
Console.WriteLine(" Individual Rules:");
|
||||
foreach (var kv in ruleGroups)
|
||||
{
|
||||
if (!kv.Value.Any())
|
||||
if (kv.Value.Count == 0)
|
||||
continue;
|
||||
|
||||
Console.WriteLine(" " + kv.Key + ":");
|
||||
@@ -130,7 +130,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
mapFiles.Save();
|
||||
Console.WriteLine("COMPLETE");
|
||||
|
||||
if (manualSteps.Any())
|
||||
if (manualSteps.Count > 0)
|
||||
{
|
||||
Console.WriteLine(" Manual changes are required to complete this update:");
|
||||
foreach (var manualStep in manualSteps)
|
||||
@@ -140,7 +140,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
if (externalFilenames.Any())
|
||||
if (externalFilenames.Count > 0)
|
||||
{
|
||||
Console.WriteLine("The following shared yaml files referenced by the map have been ignored:");
|
||||
Console.WriteLine(UpdateUtils.FormatMessageList(externalFilenames));
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
Console.WriteLine(" Individual Rules:");
|
||||
foreach (var kv in ruleGroups)
|
||||
{
|
||||
if (!kv.Value.Any())
|
||||
if (kv.Value.Count == 0)
|
||||
continue;
|
||||
|
||||
Console.WriteLine(" " + kv.Key + ":");
|
||||
@@ -205,7 +205,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
var mapSteps = UpdateUtils.UpdateMap(modData, package, rule, out var mapFiles, mapExternalFilenames);
|
||||
allFiles.AddRange(mapFiles);
|
||||
|
||||
if (mapSteps.Any())
|
||||
if (mapSteps.Count > 0)
|
||||
manualSteps.Add("Map: " + package.Name + ":\n" + UpdateUtils.FormatMessageList(mapSteps));
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -237,7 +237,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
// Files are saved after each successful automated rule update
|
||||
allFiles.Save();
|
||||
|
||||
if (manualSteps.Any())
|
||||
if (manualSteps.Count > 0)
|
||||
{
|
||||
LogLine(logWriter, " Manual changes are required to complete this update:");
|
||||
LogLine(logWriter, UpdateUtils.FormatMessageList(manualSteps, 1));
|
||||
@@ -246,7 +246,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
LogLine(logWriter);
|
||||
}
|
||||
|
||||
if (externalFilenames.Any())
|
||||
if (externalFilenames.Count > 0)
|
||||
{
|
||||
LogLine(logWriter, "The following external mod files have been ignored:");
|
||||
LogLine(logWriter, UpdateUtils.FormatMessageList(externalFilenames));
|
||||
|
||||
Reference in New Issue
Block a user