Fix RCS1041

This commit is contained in:
RoosterDragon
2023-03-18 12:02:32 +00:00
committed by Gustas
parent 917b0512bf
commit 9f1ea57d3c
15 changed files with 17 additions and 14 deletions

View File

@@ -959,6 +959,9 @@ dotnet_diagnostic.RCS1034.severity = warning
# Remove argument list from attribute.
dotnet_diagnostic.RCS1039.severity = warning
# Remove empty initializer.
dotnet_diagnostic.RCS1041.severity = warning
# Remove enum default underlying type.
dotnet_diagnostic.RCS1042.severity = warning

View File

@@ -86,7 +86,7 @@ namespace OpenRA.Primitives
public static BitSet<T> FromStringsNoAlloc(string[] values)
{
return new BitSet<T>(BitSetAllocator<T>.GetBitsNoAlloc(values)) { };
return new BitSet<T>(BitSetAllocator<T>.GetBitsNoAlloc(values));
}
public override string ToString()

View File

@@ -99,7 +99,7 @@ namespace OpenRA.Primitives
public static LongBitSet<T> FromStringsNoAlloc(string[] values)
{
return new LongBitSet<T>(LongBitSetAllocator<T>.GetBitsNoAlloc(values)) { };
return new LongBitSet<T>(LongBitSetAllocator<T>.GetBitsNoAlloc(values));
}
public static void Reset()

View File

@@ -232,7 +232,7 @@ namespace OpenRA.Mods.Cnc.SpriteLoaders
var eof = new ImageHeader { FileOffset = (uint)dataOffset };
eof.WriteTo(bw);
var allZeroes = new ImageHeader { };
var allZeroes = new ImageHeader();
allZeroes.WriteTo(bw);
foreach (var f in compressedFrames)

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Cnc.Traits
[ActorReference]
[Desc("Actor types that should be treated as veins for adjacency.")]
public readonly HashSet<string> VeinholeActors = new() { };
public readonly HashSet<string> VeinholeActors = new();
public override object Create(ActorInitializer init) { return new TSEditorResourceLayer(init.Self, this); }
}

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Cnc.Traits
[ActorReference]
[Desc("Actor types that should be treated as veins for adjacency.")]
public readonly HashSet<string> VeinholeActors = new() { };
public readonly HashSet<string> VeinholeActors = new();
public override object Create(ActorInitializer init) { return new TSResourceLayer(init.Self, this); }
}

View File

@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Cnc.Traits
[ActorReference]
[Desc("Actor types that should be treated as veins for adjacency.")]
public readonly HashSet<string> VeinholeActors = new() { };
public readonly HashSet<string> VeinholeActors = new();
void IMapPreviewSignatureInfo.PopulateMapPreviewSignatureCells(Map map, ActorInfo ai, ActorReference s, List<(MPos Uv, Color Color)> destinationBuffer)
{

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Effects
readonly Animation flag;
readonly Animation circles;
readonly List<WPos> targetLineNodes = new() { };
readonly List<WPos> targetLineNodes = new();
List<CPos> cachedLocations;
public RallyPointIndicator(Actor building, RallyPoint rp)

View File

@@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits
public class ActorSpawnerInfo : ConditionalTraitInfo
{
[Desc("Type of ActorSpawner with which it connects.")]
public readonly HashSet<string> Types = new() { };
public readonly HashSet<string> Types = new();
public override object Create(ActorInitializer init) { return new ActorSpawner(this); }
}

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
[ActorReference]
[FieldLoader.Require]
public readonly HashSet<string> DockActors = new() { };
public readonly HashSet<string> DockActors = new();
[VoiceReference]
public readonly string Voice = "Action";

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
{
[ActorReference]
[FieldLoader.Require]
public readonly HashSet<string> RepairActors = new() { };
public readonly HashSet<string> RepairActors = new();
[VoiceReference]
public readonly string Voice = "Action";

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits
[ActorReference]
[FieldLoader.Require]
[Desc("Actors that this actor can dock to and get rearmed by.")]
public readonly HashSet<string> RearmActors = new() { };
public readonly HashSet<string> RearmActors = new();
[Desc("Name(s) of AmmoPool(s) that use this trait to rearm.")]
public readonly HashSet<string> AmmoPools = new() { "primary" };

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
{
[ActorReference]
[FieldLoader.Require]
public readonly HashSet<string> RepairActors = new() { };
public readonly HashSet<string> RepairActors = new();
[VoiceReference]
public readonly string Voice = "Action";

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
{
[ActorReference]
[FieldLoader.Require]
public readonly HashSet<string> RepairActors = new() { };
public readonly HashSet<string> RepairActors = new();
public readonly WDist CloseEnough = WDist.FromCells(4);

View File

@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly string Owner = "Creeps";
[Desc("Type of ActorSpawner with which it connects.")]
public readonly HashSet<string> Types = new() { };
public readonly HashSet<string> Types = new();
public override void RulesetLoaded(Ruleset rules, ActorInfo ai)
{