Fix IDE0090

This commit is contained in:
RoosterDragon
2023-04-05 19:34:12 +01:00
committed by Pavel Penev
parent 164abfdae1
commit 8a285f9b19
385 changed files with 790 additions and 794 deletions

View File

@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
"ResourceType.PipColor has been removed and resource pip colours are now defined\n" +
"in WithHarvesterPipsDecoration.ResourceSequences.";
static readonly Dictionary<string, string> PipReplacements = new Dictionary<string, string>
static readonly Dictionary<string, string> PipReplacements = new()
{
{ "transparent", "pip-empty" },
{ "green", "pip-green" },
@@ -41,11 +41,11 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
};
bool customPips;
readonly List<string> locations = new List<string>();
readonly List<string> cargoPipLocations = new List<string>();
readonly HashSet<string> cargoCustomPips = new HashSet<string>();
readonly List<string> harvesterPipLocations = new List<string>();
readonly Dictionary<string, string> harvesterCustomPips = new Dictionary<string, string>();
readonly List<string> locations = new();
readonly List<string> cargoPipLocations = new();
readonly HashSet<string> cargoCustomPips = new();
readonly List<string> harvesterPipLocations = new();
readonly Dictionary<string, string> harvesterCustomPips = new();
public override IEnumerable<string> AfterUpdate(ModData modData)
{

View File

@@ -82,7 +82,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
power.AddNode(new MiniYamlNode("Footprint", footprint));
}
readonly List<string> locations = new List<string>();
readonly List<string> locations = new();
public override IEnumerable<string> AfterUpdate(ModData modData)
{

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
public override string Description => "The trait NukePower (via the NukeLaunch projectile that it uses) no longer has built-in palette flashing.";
readonly List<Tuple<string, string, string>> weaponsToUpdate = new List<Tuple<string, string, string>>();
readonly List<Tuple<string, string, string>> weaponsToUpdate = new();
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{

View File

@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
Right = 8,
}
static readonly Dictionary<LegacyReferencePoints, string> PositionMap = new Dictionary<LegacyReferencePoints, string>()
static readonly Dictionary<LegacyReferencePoints, string> PositionMap = new()
{
{ LegacyReferencePoints.Center, "Center" },
{ LegacyReferencePoints.Top, "Top" },
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{ LegacyReferencePoints.Bottom | LegacyReferencePoints.Right, "BottomRight" }
};
readonly Dictionary<string, List<string>> locations = new Dictionary<string, List<string>>();
readonly Dictionary<string, List<string>> locations = new();
public override IEnumerable<string> AfterUpdate(ModData modData)
{

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
"UseClassicFacingFudge has been replaced with ClassicFacingBodyOrientation trait\n" +
"and Classic* variants of *Sequence loaders respectively, both located in Mods.Cnc.";
readonly List<string> locations = new List<string>();
readonly List<string> locations = new();
public override IEnumerable<string> AfterUpdate(ModData modData)
{

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
"TurnToDock is removed from the Aircraft trait in favor of letting the Exit trait on the host" +
"building determine whether or not turning is required and to what facing the aircraft must turn.";
readonly List<Tuple<string, string>> turningAircraft = new List<Tuple<string, string>>();
readonly List<Tuple<string, string>> turningAircraft = new();
public override IEnumerable<string> AfterUpdate(ModData modData)
{

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
class ReplaceFacingAngles : UpdateRule
{
static readonly Dictionary<string, string[]> TraitFields = new Dictionary<string, string[]>()
static readonly Dictionary<string, string[]> TraitFields = new()
{
{ "Aircraft", new[] { "InitialFacing", "PreviewFacing", "TurnSpeed", "IdleTurnSpeed" } },
{ "Mobile", new[] { "InitialFacing", "PreviewFacing", "TurnSpeed" } },
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{ "AttackTesla", new[] { "FacingTolerance" } },
};
static readonly Dictionary<string, string[]> ProjectileFields = new Dictionary<string, string[]>()
static readonly Dictionary<string, string[]> ProjectileFields = new()
{
{ "Missile", new[] { "HorizontalRateOfTurn", "VerticalRateOfTurn" } }
};

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
"SequencePlaceBuildingPreview, and D2kActorPreviewPlaceBuildingPreview traits have been removed.\n" +
"New Alpha and LineBuildSegmentAlpha properties have been added in their place.";
readonly List<string> locations = new List<string>();
readonly List<string> locations = new();
public override IEnumerable<string> AfterUpdate(ModData modData)
{

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
}
}
readonly Dictionary<string, List<string>> locations = new Dictionary<string, List<string>>();
readonly Dictionary<string, List<string>> locations = new();
public override IEnumerable<string> AfterUpdate(ModData modData)
{

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
"The ShadowPalette field has been replaced by ShadowColor on projectiles.\n" +
"The Palette field on WithShadow and ShadowPalette on WithParachute have similarly been replaced with ShadowColor.";
readonly List<string> locations = new List<string>();
readonly List<string> locations = new();
public override IEnumerable<string> AfterUpdate(ModData modData)
{

View File

@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
public override string Description => "The Palette field has been removed from WithColoredOverlay. You must now specify the Color directly.";
readonly List<string> locations = new List<string>();
readonly List<string> locations = new();
public override IEnumerable<string> AfterUpdate(ModData modData)
{

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class UnhardcodeSquadManager : UpdateRule
{
readonly List<MiniYamlNode> addNodes = new List<MiniYamlNode>();
readonly List<MiniYamlNode> addNodes = new();
// Excludes AttackBomber and AttackTDGunboatTurreted as actors with these AttackBase traits aren't supposed to be controlled.
readonly string[] attackBase = { "AttackLeap", "AttackPopupTurreted", "AttackAircraft", "AttackTesla", "AttackCharges", "AttackFollow", "AttackTurreted", "AttackFrontal", "AttackGarrisoned", "AttackOmni", "AttackSwallow" };

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
public override string Description => "ProductionIconOverlayManager now works with the new WithProductionIconOverlay trait, instead of ProducibleWithLevel.";
readonly List<string> locations = new List<string>();
readonly List<string> locations = new();
public override IEnumerable<string> AfterUpdate(ModData modData)
{

View File

@@ -27,8 +27,8 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
string defaultSpriteExtension = ".shp";
List<MiniYamlNode> resolvedImagesNodes;
readonly Dictionary<string, string> tilesetExtensions = new Dictionary<string, string>();
readonly Dictionary<string, string> tilesetCodes = new Dictionary<string, string>();
readonly Dictionary<string, string> tilesetExtensions = new();
readonly Dictionary<string, string> tilesetCodes = new();
bool parseModYaml = true;
bool reportModYamlChanges;
bool disabled;

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
"The PaletteFromEmbeddedSpritePalette trait no longer references a sequence.\n" +
"Image and Sequence are replaced by Filename and Frame.";
readonly HashSet<string> locations = new HashSet<string>();
readonly HashSet<string> locations = new();
public override IEnumerable<string> AfterUpdate(ModData modData)
{

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
static readonly string[] SourceFiles = { "art.ini", "artfs.ini", "artmd.ini" };
readonly Dictionary<string, int> selectionHeight = new Dictionary<string, int>();
readonly Dictionary<string, int> selectionHeight = new();
bool complete;