diff --git a/OpenRA.Mods.Common/Lint/CheckAngle.cs b/OpenRA.Mods.Common/Lint/CheckAngle.cs index 45eb993e64..3373d44c90 100644 --- a/OpenRA.Mods.Common/Lint/CheckAngle.cs +++ b/OpenRA.Mods.Common/Lint/CheckAngle.cs @@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Lint var minAngle = missile.MinimumLaunchAngle.Angle; var maxAngle = missile.MaximumLaunchAngle.Angle; - // If both angles are identical, we only need to test one of them + // If both angles are identical, we only need to test one of them. var testMaxAngle = minAngle != maxAngle; CheckLaunchAngles(weaponInfo.Key, minAngle, testMaxAngle, maxAngle, emitError); } @@ -46,7 +46,7 @@ namespace OpenRA.Mods.Common.Lint var minAngle = bullet.LaunchAngle[0].Angle; var maxAngle = bullet.LaunchAngle.Length > 1 ? bullet.LaunchAngle[1].Angle : minAngle; - // If both angles are identical, we only need to test one of them + // If both angles are identical, we only need to test one of them. var testMaxAngle = minAngle != maxAngle; CheckLaunchAngles(weaponInfo.Key, minAngle, testMaxAngle, maxAngle, emitError); } diff --git a/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs b/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs index 8f72eac535..12e9ca8e50 100644 --- a/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs +++ b/OpenRA.Mods.Common/Lint/CheckChromeHotkeys.cs @@ -33,10 +33,10 @@ namespace OpenRA.Mods.Common.Lint { public void Run(Action emitError, Action emitWarning, ModData modData) { - // Build the list of valid hotkey names + // Build the list of valid hotkey names. var namedKeys = modData.Hotkeys.Definitions.Select(d => d.Name).ToArray(); - // Build the list of widget keys to validate + // Build the list of widget keys to validate. var checkWidgetFields = modData.ObjectCreator.GetTypesImplementing() .SelectMany(w => Utility.GetFields(w) .Where(f => f.FieldType == typeof(HotkeyReference)) @@ -81,7 +81,7 @@ namespace OpenRA.Mods.Common.Lint } } - // Check runtime-defined hotkey names + // Check runtime-defined hotkey names. var widgetType = node.Key.Split('@')[0]; if (customLintMethods.TryGetValue(widgetType, out var checkMethods)) { @@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Lint emitError($"{node.Location} refers to a Key named `{name}` that does not exist"); } - // Logic classes can declare the data key names that specify hotkeys + // Logic classes can declare the data key names that specify hotkeys. if (node.Key == "Logic" && node.Value.Nodes.Count > 0) { var typeNames = FieldLoader.GetValue(node.Key, node.Value.Value); diff --git a/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs b/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs index 5f868541b6..33d0855f3c 100644 --- a/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs +++ b/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Lint { foreach (var actorInfo in rules.Actors) { - // Catch TypeDictionary errors + // Catch TypeDictionary errors. try { var count = actorInfo.Value.TraitInfos().Count(); diff --git a/OpenRA.Mods.Common/Lint/CheckHitShapes.cs b/OpenRA.Mods.Common/Lint/CheckHitShapes.cs index 8abe842f67..553b316a99 100644 --- a/OpenRA.Mods.Common/Lint/CheckHitShapes.cs +++ b/OpenRA.Mods.Common/Lint/CheckHitShapes.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Lint { foreach (var actorInfo in rules.Actors) { - // Catch TypeDictionary errors + // Catch TypeDictionary errors. try { var health = actorInfo.Value.TraitInfoOrDefault(); diff --git a/OpenRA.Mods.Common/Lint/CheckOwners.cs b/OpenRA.Mods.Common/Lint/CheckOwners.cs index b834e3db09..742acca580 100644 --- a/OpenRA.Mods.Common/Lint/CheckOwners.cs +++ b/OpenRA.Mods.Common/Lint/CheckOwners.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Lint .Select(p => p.Name) .ToHashSet(); - // Check for actors that require specific owners + // Check for actors that require specific owners. var actorsWithRequiredOwner = map.Rules.Actors .Where(a => a.Value.HasTraitInfo()) .ToDictionary(a => a.Key, a => a.Value.TraitInfo()); diff --git a/OpenRA.Mods.Common/Lint/CheckPalettes.cs b/OpenRA.Mods.Common/Lint/CheckPalettes.cs index 851b789c97..bb2b8067e6 100644 --- a/OpenRA.Mods.Common/Lint/CheckPalettes.cs +++ b/OpenRA.Mods.Common/Lint/CheckPalettes.cs @@ -156,7 +156,7 @@ namespace OpenRA.Mods.Common.Lint { tilesetPalettes.Add(tilesetPalette); - // Only add the basic palette name once + // Only add the basic palette name once. if (!palettes.Contains(value)) palettes.Add(value); } diff --git a/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs b/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs index a75ce058cf..77953c70f1 100644 --- a/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs +++ b/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Lint { foreach (var actorInfo in rules.Actors) { - // Catch TypeDictionary errors + // Catch TypeDictionary errors. try { var ios = actorInfo.Value.TraitInfoOrDefault(); diff --git a/OpenRA.Mods.Common/Lint/CheckSequences.cs b/OpenRA.Mods.Common/Lint/CheckSequences.cs index 5ff7950dee..26a200efb6 100644 --- a/OpenRA.Mods.Common/Lint/CheckSequences.cs +++ b/OpenRA.Mods.Common/Lint/CheckSequences.cs @@ -39,25 +39,25 @@ namespace OpenRA.Mods.Common.Lint var factions = rules.Actors[SystemActors.World].TraitInfos().Select(f => f.InternalName).ToArray(); foreach (var actorInfo in rules.Actors) { - // Catch TypeDictionary errors + // Catch TypeDictionary errors. try { var images = new HashSet(); - // Actors may have 0 or 1 RenderSprites traits + // Actors may have 0 or 1 RenderSprites traits. var renderInfo = actorInfo.Value.TraitInfoOrDefault(); if (renderInfo != null) { images.Add(renderInfo.GetImage(actorInfo.Value, null).ToLowerInvariant()); - // Some actors define faction-specific artwork + // Some actors define faction-specific artwork. foreach (var faction in factions) images.Add(renderInfo.GetImage(actorInfo.Value, faction).ToLowerInvariant()); } foreach (var traitInfo in actorInfo.Value.TraitInfos()) { - // Remove the "Info" suffix + // Remove the "Info" suffix. var traitName = traitInfo.GetType().Name; traitName = traitName.Remove(traitName.Length - 4); @@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Lint if (sequenceReference == null) continue; - // Some sequences may specify their own Image override + // Some sequences may specify their own Image override. IEnumerable sequenceImages = images; if (!string.IsNullOrEmpty(sequenceReference.ImageReference)) { @@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.Lint { if (sequenceReference.Prefix) { - // TODO: Remove prefixed sequence references and instead use explicit lists of lintable references + // TODO: Remove prefixed sequence references and instead use explicit lists of lintable references. if (!sequences.Sequences(i).Any(s => s.StartsWith(sequence))) emitWarning($"Actor type `{actorInfo.Value.Name}` trait `{traitName}` field `{field.Name}` defines a prefix `{sequence}` that does not match any sequences on image `{i}`."); } @@ -124,7 +124,7 @@ namespace OpenRA.Mods.Common.Lint if (sequenceReference == null) continue; - // All weapon sequences must specify their corresponding image + // All weapon sequences must specify their corresponding image. var image = (string)fields.First(f => f.Name == sequenceReference.ImageReference).GetValue(projectileInfo); if (string.IsNullOrEmpty(image)) { @@ -142,7 +142,7 @@ namespace OpenRA.Mods.Common.Lint if (sequenceReference.Prefix) { - // TODO: Remove prefixed sequence references and instead use explicit lists of lintable references + // TODO: Remove prefixed sequence references and instead use explicit lists of lintable references. if (!sequences.Sequences(image).Any(s => s.StartsWith(sequence))) emitWarning($"Weapon type `{weaponInfo.Key}` projectile field `{field.Name}` defines a prefix `{sequence}` that does not match any sequences on image `{image}`."); } diff --git a/OpenRA.Mods.Common/Lint/CheckTooltips.cs b/OpenRA.Mods.Common/Lint/CheckTooltips.cs index ecef3b977b..8004c50c22 100644 --- a/OpenRA.Mods.Common/Lint/CheckTooltips.cs +++ b/OpenRA.Mods.Common/Lint/CheckTooltips.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Lint { foreach (var actorInfo in rules.Actors) { - // Catch TypeDictionary errors + // Catch TypeDictionary errors. try { var buildable = actorInfo.Value.TraitInfoOrDefault(); diff --git a/OpenRA.Mods.Common/Lint/CheckTraitLocation.cs b/OpenRA.Mods.Common/Lint/CheckTraitLocation.cs index db459ba4b7..f5ed751572 100644 --- a/OpenRA.Mods.Common/Lint/CheckTraitLocation.cs +++ b/OpenRA.Mods.Common/Lint/CheckTraitLocation.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Lint if (!Enum.TryParse(actorInfo.Key, true, out SystemActors systemActor) || !traitLocation.SystemActors.HasFlag(systemActor)) { - // Remove the "Info" suffix + // Remove the "Info" suffix. var traitName = traitInfo.GetType().Name; traitName = traitName.Remove(traitName.Length - 4); var locations = traitLocation.SystemActors.ToString().Replace(", ", " or "); diff --git a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs index 7857fda0af..4b6eda28ca 100644 --- a/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs +++ b/OpenRA.Mods.Common/Lint/CheckTranslationReference.cs @@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Lint foreach (var entry in result.Entries) { - // Don't flag definitions referenced (only) within the .ftl definitions as unused + // Don't flag definitions referenced (only) within the .ftl definitions as unused. if (entry.GetType() == typeof(AstTerm)) continue; diff --git a/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs b/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs index 271ca97777..173449f7cb 100644 --- a/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs +++ b/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs @@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Lint { foreach (var t in actor.Value.Nodes) { - // Removals can never define children or values + // Removals can never define children or values. if (t.Key.StartsWith("-", StringComparison.Ordinal)) { if (t.Value.Nodes.Count > 0) @@ -63,7 +63,7 @@ namespace OpenRA.Mods.Common.Lint var traitName = NormalizeName(t.Key); - // Inherits can never define children + // Inherits can never define children. if (traitName == "Inherits") { if (t.Value.Nodes.Count > 0) diff --git a/OpenRA.Mods.Common/Lint/CheckWorldAndPlayerInherits.cs b/OpenRA.Mods.Common/Lint/CheckWorldAndPlayerInherits.cs index 72b9593ff6..deefc97f82 100644 --- a/OpenRA.Mods.Common/Lint/CheckWorldAndPlayerInherits.cs +++ b/OpenRA.Mods.Common/Lint/CheckWorldAndPlayerInherits.cs @@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Lint void Run(Action emitError, List nodes) { - // Build a list of all inheritance relationships + // Build a list of all inheritance relationships. var inheritsMap = new Dictionary>(); foreach (var actorNode in nodes) { @@ -79,7 +79,7 @@ namespace OpenRA.Mods.Common.Lint var toResolve = new Queue(inheritsMap.Keys.Where(k => string.Equals(k, actor, StringComparison.InvariantCultureIgnoreCase))); while (toResolve.TryDequeue(out var key)) { - // Missing keys are a fatal merge error, so will have already been reported by other lint checks + // Missing keys are a fatal merge error, so will have already been reported by other lint checks. if (!inheritsMap.TryGetValue(key, out var inherits)) continue; diff --git a/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs b/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs index fe69f5355e..129c28bcf7 100644 --- a/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs +++ b/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs @@ -32,10 +32,10 @@ namespace OpenRA.Mods.Common.Lint { var providedPrereqs = rules.Actors.SelectMany(a => a.Value.TraitInfos().SelectMany(p => p.Prerequisites(a.Value))); - // TODO: this check is case insensitive while the real check in-game is not + // TODO: this check is case insensitive while the real check in-game is not. foreach (var actorInfo in rules.Actors) { - // Catch TypeDictionary errors + // Catch TypeDictionary errors. try { var bi = actorInfo.Value.TraitInfoOrDefault(); diff --git a/OpenRA.Mods.Common/Lint/LintExts.cs b/OpenRA.Mods.Common/Lint/LintExts.cs index 651837dcc0..f27c5300e4 100644 --- a/OpenRA.Mods.Common/Lint/LintExts.cs +++ b/OpenRA.Mods.Common/Lint/LintExts.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Lint if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>)) { - // Use an intermediate list to cover the unlikely case where both keys and values are lintable + // Use an intermediate list to cover the unlikely case where both keys and values are lintable. var dictionaryValues = new List(); if (dictionaryReference.HasFlag(LintDictionaryReference.Keys) && type.GenericTypeArguments[0] == typeof(string)) dictionaryValues.AddRange((IEnumerable)((IDictionary)fieldInfo.GetValue(ruleInfo)).Keys); @@ -84,7 +84,7 @@ namespace OpenRA.Mods.Common.Lint if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>)) { - // Use an intermediate list to cover the unlikely case where both keys and values are lintable + // Use an intermediate list to cover the unlikely case where both keys and values are lintable. var dictionaryValues = new List(); if (dictionaryReference.HasFlag(LintDictionaryReference.Keys) && type.GenericTypeArguments[0] == typeof(string)) dictionaryValues.AddRange((IEnumerable)((IDictionary)propertyInfo.GetValue(ruleInfo)).Keys);