From 14c0d011ea884ba21f0938e952c4e156cec6163d Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Wed, 5 Apr 2023 19:41:28 +0100 Subject: [PATCH] Fix SA1414 --- .editorconfig | 3 --- OpenRA.Game/Graphics/SequenceSet.cs | 2 +- OpenRA.Game/Traits/TraitsInterfaces.cs | 2 +- OpenRA.Game/WRot.cs | 2 +- OpenRA.Mods.Cnc/Traits/World/TSVeinsRenderer.cs | 2 +- OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs | 2 +- OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs | 2 +- OpenRA.Mods.Common/Traits/AppearsOnMapPreview.cs | 2 +- OpenRA.Mods.Common/Traits/World/ResourceRenderer.cs | 2 +- OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs | 2 +- 10 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.editorconfig b/.editorconfig index 359e20910c..fa72b95712 100644 --- a/.editorconfig +++ b/.editorconfig @@ -598,9 +598,6 @@ dotnet_diagnostic.SA1633.severity = none # FileMustHaveHeader dotnet_diagnostic.SA1642.severity = none # ConstructorSummaryDocumentationShouldBeginWithStandardText dotnet_diagnostic.SA1649.severity = none # FileNameMustMatchTypeName -# Requires C# 8/9 - TODO Consider enabling -dotnet_diagnostic.SA1414.severity = none # TupleTypesInSignaturesShouldHaveElementNames - #### Code Quality Rules #### https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ diff --git a/OpenRA.Game/Graphics/SequenceSet.cs b/OpenRA.Game/Graphics/SequenceSet.cs index b683d95d37..7a3b32c0cb 100644 --- a/OpenRA.Game/Graphics/SequenceSet.cs +++ b/OpenRA.Game/Graphics/SequenceSet.cs @@ -30,7 +30,7 @@ namespace OpenRA.Graphics void ResolveSprites(SpriteCache cache); Sprite GetSprite(int frame); Sprite GetSprite(int frame, WAngle facing); - (Sprite, WAngle) GetSpriteWithRotation(int frame, WAngle facing); + (Sprite Sprite, WAngle Rotation) GetSpriteWithRotation(int frame, WAngle facing); Sprite GetShadow(int frame, WAngle facing); float GetAlpha(int frame); } diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index accc30818b..56c6a61ca1 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -272,7 +272,7 @@ namespace OpenRA.Traits public interface IMapPreviewSignatureInfo : ITraitInfoInterface { - void PopulateMapPreviewSignatureCells(Map map, ActorInfo ai, ActorReference s, List<(MPos, Color)> destinationBuffer); + void PopulateMapPreviewSignatureCells(Map map, ActorInfo ai, ActorReference s, List<(MPos Uv, Color Color)> destinationBuffer); } public interface IOccupySpaceInfo : ITraitInfoInterface diff --git a/OpenRA.Game/WRot.cs b/OpenRA.Game/WRot.cs index 338196e2ea..c581d762c1 100644 --- a/OpenRA.Game/WRot.cs +++ b/OpenRA.Game/WRot.cs @@ -76,7 +76,7 @@ namespace OpenRA (Roll, Pitch, Yaw) = QuaternionToEuler(x, y, z, w); } - static (WAngle, WAngle, WAngle) QuaternionToEuler(int x, int y, int z, int w) + static (WAngle Roll, WAngle Pitch, WAngle Yaw) QuaternionToEuler(int x, int y, int z, int w) { // Theoretically 1024 squared, but may differ slightly due to rounding var lsq = x * x + y * y + z * z + w * w; diff --git a/OpenRA.Mods.Cnc/Traits/World/TSVeinsRenderer.cs b/OpenRA.Mods.Cnc/Traits/World/TSVeinsRenderer.cs index 1aa0e7e5dc..8230e89fb7 100644 --- a/OpenRA.Mods.Cnc/Traits/World/TSVeinsRenderer.cs +++ b/OpenRA.Mods.Cnc/Traits/World/TSVeinsRenderer.cs @@ -46,7 +46,7 @@ namespace OpenRA.Mods.Cnc.Traits [Desc("Actor types that should be treated as veins for adjacency.")] public readonly HashSet VeinholeActors = new() { }; - void IMapPreviewSignatureInfo.PopulateMapPreviewSignatureCells(Map map, ActorInfo ai, ActorReference s, List<(MPos, Color)> destinationBuffer) + void IMapPreviewSignatureInfo.PopulateMapPreviewSignatureCells(Map map, ActorInfo ai, ActorReference s, List<(MPos Uv, Color Color)> destinationBuffer) { var resourceLayer = ai.TraitInfoOrDefault(); if (resourceLayer == null) diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs index cf4a1f1ed4..d9e9af2f8f 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs @@ -192,7 +192,7 @@ namespace OpenRA.Mods.Common.Widgets readonly Queue addedActorPreviews = new(); public CopyPasteEditorAction(MapCopyFilters copyFilters, Map map, - Dictionary tiles, Dictionary previews, + Dictionary tiles, Dictionary previews, EditorActorLayer editorLayer, CellRegion dest) { this.copyFilters = copyFilters; diff --git a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs index 015b65279c..e01d5b0432 100644 --- a/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs +++ b/OpenRA.Mods.Common/Graphics/DefaultSpriteSequence.cs @@ -543,7 +543,7 @@ namespace OpenRA.Mods.Common.Graphics return GetSprite(frame, WAngle.Zero); } - public (Sprite, WAngle) GetSpriteWithRotation(int frame, WAngle facing) + public (Sprite Sprite, WAngle Rotation) GetSpriteWithRotation(int frame, WAngle facing) { var rotation = WAngle.Zero; if (interpolatedFacings != null) diff --git a/OpenRA.Mods.Common/Traits/AppearsOnMapPreview.cs b/OpenRA.Mods.Common/Traits/AppearsOnMapPreview.cs index fefe0e892d..19252a7d24 100644 --- a/OpenRA.Mods.Common/Traits/AppearsOnMapPreview.cs +++ b/OpenRA.Mods.Common/Traits/AppearsOnMapPreview.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits "Overrides `Color` if both set.")] public readonly string Terrain = null; - void IMapPreviewSignatureInfo.PopulateMapPreviewSignatureCells(Map map, ActorInfo ai, ActorReference s, List<(MPos, Color)> destinationBuffer) + void IMapPreviewSignatureInfo.PopulateMapPreviewSignatureCells(Map map, ActorInfo ai, ActorReference s, List<(MPos Uv, Color Color)> destinationBuffer) { Color color; if (!string.IsNullOrEmpty(Terrain)) diff --git a/OpenRA.Mods.Common/Traits/World/ResourceRenderer.cs b/OpenRA.Mods.Common/Traits/World/ResourceRenderer.cs index 26e5253d36..e05548a798 100644 --- a/OpenRA.Mods.Common/Traits/World/ResourceRenderer.cs +++ b/OpenRA.Mods.Common/Traits/World/ResourceRenderer.cs @@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Traits return ret; } - void IMapPreviewSignatureInfo.PopulateMapPreviewSignatureCells(Map map, ActorInfo ai, ActorReference s, List<(MPos, Color)> destinationBuffer) + void IMapPreviewSignatureInfo.PopulateMapPreviewSignatureCells(Map map, ActorInfo ai, ActorReference s, List<(MPos Uv, Color Color)> destinationBuffer) { var resourceLayer = ai.TraitInfoOrDefault(); if (resourceLayer == null) diff --git a/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs b/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs index 132be86c5e..413094652b 100644 --- a/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs +++ b/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs @@ -275,7 +275,7 @@ namespace OpenRA.Mods.Common.Traits return info.UseExtendedIndex ? edges ^ ucorner : edges & Edges.AllCorners; } - (Edges, Edges) GetEdges(PPos puv) + (Edges EdgesShroud, Edges EdgesFog) GetEdges(PPos puv) { var cv = cellVisibility(puv);