Skip to content

Commit

Permalink
Fix SA1316
Browse files Browse the repository at this point in the history
  • Loading branch information
RoosterDragon authored and penev92 committed Apr 8, 2023
1 parent 062dc2b commit a167f96
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ dotnet_diagnostic.SA1642.severity = none # ConstructorSummaryDocumentationShould
dotnet_diagnostic.SA1649.severity = none # FileNameMustMatchTypeName

# Requires C# 8/9 - TODO Consider enabling
dotnet_diagnostic.SA1316.severity = none # TupleElementNamesShouldUseCorrectCasing
dotnet_diagnostic.SA1414.severity = none # TupleTypesInSignaturesShouldHaveElementNames

#### Code Quality Rules
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Game/Map/MapCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public IEnumerable<IReadWritePackage> EnumerateMapDirPackages(MapClassification
}
}

public IEnumerable<(IReadWritePackage package, string map)> EnumerateMapDirPackagesAndNames(MapClassification classification = MapClassification.System)
public IEnumerable<(IReadWritePackage Package, string Map)> EnumerateMapDirPackagesAndNames(MapClassification classification = MapClassification.System)
{
var mapDirPackages = EnumerateMapDirPackages(classification);

Expand Down
10 changes: 5 additions & 5 deletions OpenRA.Mods.Common/Traits/HitShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ public class HitShape : ConditionalTrait<HitShapeInfo>, ITargetablePositions
ITargetableCells targetableCells;
Turreted turret;

((CPos Cell, SubCell SubCell)[] targetableCells,
WPos? selfCenterPosition,
WRot? selfOrientation,
WRot? turretLocalOrientation,
WVec? turretOffset) cacheInput;
((CPos Cell, SubCell SubCell)[] TargetableCells,
WPos? SelfCenterPosition,
WRot? SelfOrientation,
WRot? TurretLocalOrientation,
WVec? TurretOffset) cacheInput;

WPos[] cachedTargetablePositions;

Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void IUtilityCommand.Run(Utility utility, string[] args)
ObjectCreator.MissingTypeAction = s => EmitError($"Missing Type: {s}");
FieldLoader.UnknownFieldAction = (s, f) => EmitError($"FieldLoader: Missing field `{s}` on `{f.Name}`");

var maps = new List<(IReadWritePackage package, string map)>();
var maps = new List<(IReadWritePackage Package, string Map)>();
if (args.Length < 2)
{
Console.WriteLine($"Testing mod: {modData.Manifest.Metadata.Title}");
Expand Down Expand Up @@ -93,7 +93,7 @@ void IUtilityCommand.Run(Utility utility, string[] args)

foreach (var map in maps)
{
var package = map.package.OpenPackage(map.map, modData.ModFiles);
var package = map.Package.OpenPackage(map.Map, modData.ModFiles);
if (package == null)
continue;

Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Widgets/ImageWidget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ImageWidget : Widget
public Func<string> GetTooltipText;

readonly CachedTransform<(string, string), Sprite> getImageCache = new(
((string collection, string image) args) => ChromeProvider.GetImage(args.collection, args.image));
((string Collection, string Image) args) => ChromeProvider.GetImage(args.Collection, args.Image));

public ImageWidget()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public IngamePowerCounterLogic(Widget widget, ModData modData, World world)
power.GetColor = () => powerManager.ExcessPower < 0 ? Color.Red : Color.White;
power.GetText = () => developerMode.UnlimitedPower ? unlimitedCapacity : powerManager.ExcessPower.ToString();

var tooltipTextCached = new CachedTransform<(string, string), string>(((string usage, string capacity) args) =>
var tooltipTextCached = new CachedTransform<(string, string), string>(((string Usage, string Capacity) args) =>
{
return modData.Translation.GetString(
PowerUsage,
Translation.Arguments("usage", args.usage, "capacity", args.capacity));
Translation.Arguments("usage", args.Usage, "capacity", args.Capacity));
});

power.GetTooltipText = () =>
Expand Down

0 comments on commit a167f96

Please sign in to comment.