From b985edbc294209e8c40d6e3fce558e20256c2ec5 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 11 Aug 2020 14:32:22 +0100 Subject: [PATCH] Add ModData to ILintRulesPass.Run. --- OpenRA.Mods.Common/Lint/CheckActorReferences.cs | 2 +- OpenRA.Mods.Common/Lint/CheckAngle.cs | 2 +- OpenRA.Mods.Common/Lint/CheckConditions.cs | 2 +- OpenRA.Mods.Common/Lint/CheckConflictingMouseBounds.cs | 2 +- OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs | 2 +- OpenRA.Mods.Common/Lint/CheckHitShapes.cs | 2 +- OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs | 2 +- OpenRA.Mods.Common/Lint/CheckNotifications.cs | 2 +- OpenRA.Mods.Common/Lint/CheckPalettes.cs | 2 +- OpenRA.Mods.Common/Lint/CheckRangeLimit.cs | 2 +- OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs | 2 +- OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs | 2 +- OpenRA.Mods.Common/Lint/CheckTooltips.cs | 2 +- OpenRA.Mods.Common/Lint/CheckTraitPrerequisites.cs | 2 +- OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs | 2 +- OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs | 2 +- OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs | 2 +- OpenRA.Mods.Common/UtilityCommands/LintInterfaces.cs | 2 +- OpenRA.Mods.D2k/Lint/CheckImportActors.cs | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/OpenRA.Mods.Common/Lint/CheckActorReferences.cs b/OpenRA.Mods.Common/Lint/CheckActorReferences.cs index 4ddb220fe4..e41e9e7d62 100644 --- a/OpenRA.Mods.Common/Lint/CheckActorReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckActorReferences.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Lint { Action emitError; - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { this.emitError = emitError; diff --git a/OpenRA.Mods.Common/Lint/CheckAngle.cs b/OpenRA.Mods.Common/Lint/CheckAngle.cs index 1231c3d233..6737d33445 100644 --- a/OpenRA.Mods.Common/Lint/CheckAngle.cs +++ b/OpenRA.Mods.Common/Lint/CheckAngle.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Lint { class CheckAngle : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var weaponInfo in rules.Weapons) { diff --git a/OpenRA.Mods.Common/Lint/CheckConditions.cs b/OpenRA.Mods.Common/Lint/CheckConditions.cs index 77699903dc..d30b55eaf2 100644 --- a/OpenRA.Mods.Common/Lint/CheckConditions.cs +++ b/OpenRA.Mods.Common/Lint/CheckConditions.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Lint { public class CheckConditions : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var actorInfo in rules.Actors) { diff --git a/OpenRA.Mods.Common/Lint/CheckConflictingMouseBounds.cs b/OpenRA.Mods.Common/Lint/CheckConflictingMouseBounds.cs index 83cb2658f2..8e4c03f068 100644 --- a/OpenRA.Mods.Common/Lint/CheckConflictingMouseBounds.cs +++ b/OpenRA.Mods.Common/Lint/CheckConflictingMouseBounds.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Lint { public class CheckConflictingMouseBounds : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var actorInfo in rules.Actors) { diff --git a/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs b/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs index 677f7984f4..2eae91a3cc 100644 --- a/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs +++ b/OpenRA.Mods.Common/Lint/CheckDefaultVisibility.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Lint { class CheckDefaultVisibility : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var actorInfo in rules.Actors) { diff --git a/OpenRA.Mods.Common/Lint/CheckHitShapes.cs b/OpenRA.Mods.Common/Lint/CheckHitShapes.cs index 3cae7164c1..214b64beae 100644 --- a/OpenRA.Mods.Common/Lint/CheckHitShapes.cs +++ b/OpenRA.Mods.Common/Lint/CheckHitShapes.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Lint { class CheckHitShapes : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var actorInfo in rules.Actors) { diff --git a/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs b/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs index 3569a40bb1..45343cf8ca 100644 --- a/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckLocomotorReferences.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Lint { public class CheckLocomotorReferences : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { var worldActor = rules.Actors["world"]; var locomotorInfos = worldActor.TraitInfos().ToArray(); diff --git a/OpenRA.Mods.Common/Lint/CheckNotifications.cs b/OpenRA.Mods.Common/Lint/CheckNotifications.cs index 17596747b0..702ade149d 100644 --- a/OpenRA.Mods.Common/Lint/CheckNotifications.cs +++ b/OpenRA.Mods.Common/Lint/CheckNotifications.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Lint { class CheckNotifications : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var actorInfo in rules.Actors) { diff --git a/OpenRA.Mods.Common/Lint/CheckPalettes.cs b/OpenRA.Mods.Common/Lint/CheckPalettes.cs index d81c27e0f0..756b012005 100644 --- a/OpenRA.Mods.Common/Lint/CheckPalettes.cs +++ b/OpenRA.Mods.Common/Lint/CheckPalettes.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Lint List palettes = new List(); List playerPalettes = new List(); - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { GetPalettes(emitError, rules); diff --git a/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs b/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs index 31e23a5cb2..132cf25f3b 100644 --- a/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs +++ b/OpenRA.Mods.Common/Lint/CheckRangeLimit.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Lint { class CheckRangeLimit : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var weaponInfo in rules.Weapons) { diff --git a/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs b/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs index e329474575..5f875cb1c5 100644 --- a/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs +++ b/OpenRA.Mods.Common/Lint/CheckRevealFootprint.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Lint { class CheckRevealFootprint : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var actorInfo in rules.Actors) { diff --git a/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs b/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs index 0fb990c27e..4e9edf4872 100644 --- a/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs +++ b/OpenRA.Mods.Common/Lint/CheckSpriteBodies.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Lint { class CheckSpriteBodies : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var actorInfo in rules.Actors) { diff --git a/OpenRA.Mods.Common/Lint/CheckTooltips.cs b/OpenRA.Mods.Common/Lint/CheckTooltips.cs index c56ba4f406..551aca6ca9 100644 --- a/OpenRA.Mods.Common/Lint/CheckTooltips.cs +++ b/OpenRA.Mods.Common/Lint/CheckTooltips.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Lint { class CheckTooltips : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var actorInfo in rules.Actors) { diff --git a/OpenRA.Mods.Common/Lint/CheckTraitPrerequisites.cs b/OpenRA.Mods.Common/Lint/CheckTraitPrerequisites.cs index 315a7f953c..5ed12297d7 100644 --- a/OpenRA.Mods.Common/Lint/CheckTraitPrerequisites.cs +++ b/OpenRA.Mods.Common/Lint/CheckTraitPrerequisites.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Lint { public class CheckTraitPrerequisites : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var actorInfo in rules.Actors) { diff --git a/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs b/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs index b5db60151d..4595d558c3 100644 --- a/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs +++ b/OpenRA.Mods.Common/Lint/CheckVoiceReferences.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Lint { public class CheckVoiceReferences : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var actorInfo in rules.Actors) { diff --git a/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs b/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs index 1a39295028..579418048c 100644 --- a/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs +++ b/OpenRA.Mods.Common/Lint/LintBuildablePrerequisites.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Lint { class LintBuildablePrerequisites : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { var providedPrereqs = rules.Actors.SelectMany(a => a.Value.TraitInfos().SelectMany(p => p.Prerequisites(a.Value))); diff --git a/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs b/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs index 1f4076fc14..6be1151799 100644 --- a/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs +++ b/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs @@ -134,7 +134,7 @@ namespace OpenRA.Mods.Common.UtilityCommands try { var customRulesPass = (ILintRulesPass)modData.ObjectCreator.CreateBasic(customRulesPassType); - customRulesPass.Run(EmitError, EmitWarning, rules); + customRulesPass.Run(EmitError, EmitWarning, modData, rules); } catch (Exception e) { diff --git a/OpenRA.Mods.Common/UtilityCommands/LintInterfaces.cs b/OpenRA.Mods.Common/UtilityCommands/LintInterfaces.cs index 565ddab657..b1f77bf407 100644 --- a/OpenRA.Mods.Common/UtilityCommands/LintInterfaces.cs +++ b/OpenRA.Mods.Common/UtilityCommands/LintInterfaces.cs @@ -15,5 +15,5 @@ namespace OpenRA.Mods.Common.Lint { public interface ILintPass { void Run(Action emitError, Action emitWarning, ModData modData); } public interface ILintMapPass { void Run(Action emitError, Action emitWarning, ModData modData, Map map); } - public interface ILintRulesPass { void Run(Action emitError, Action emitWarning, Ruleset rules); } + public interface ILintRulesPass { void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules); } } diff --git a/OpenRA.Mods.D2k/Lint/CheckImportActors.cs b/OpenRA.Mods.D2k/Lint/CheckImportActors.cs index 6692b6e3e5..a0e8b5ea07 100644 --- a/OpenRA.Mods.D2k/Lint/CheckImportActors.cs +++ b/OpenRA.Mods.D2k/Lint/CheckImportActors.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.D2k.Lint { public class CheckImportActors : ILintRulesPass { - public void Run(Action emitError, Action emitWarning, Ruleset rules) + public void Run(Action emitError, Action emitWarning, ModData modData, Ruleset rules) { foreach (var actorData in D2kMapImporter.ActorDataByActorCode.Values) {