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

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
public class GrantConditionOnPrerequisiteManager : ITechTreeElement
{
readonly Actor self;
readonly Dictionary<string, List<(Actor Actor, GrantConditionOnPrerequisite GrantConditionOnPrerequisite)>> upgradables = new Dictionary<string, List<(Actor, GrantConditionOnPrerequisite)>>();
readonly Dictionary<string, List<(Actor Actor, GrantConditionOnPrerequisite GrantConditionOnPrerequisite)>> upgradables = new();
readonly TechTree techTree;
public GrantConditionOnPrerequisiteManager(ActorInitializer init)

View File

@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits
[FieldLoader.Require]
[Desc("Prerequisites to grant when this checkbox is enabled.")]
public readonly HashSet<string> Prerequisites = new HashSet<string>();
public readonly HashSet<string> Prerequisites = new();
IEnumerable<string> ITechTreePrerequisiteInfo.Prerequisites(ActorInfo info) { return Prerequisites; }
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits
public class LobbyPrerequisiteCheckbox : INotifyCreated, ITechTreePrerequisite
{
readonly LobbyPrerequisiteCheckboxInfo info;
HashSet<string> prerequisites = new HashSet<string>();
HashSet<string> prerequisites = new();
public LobbyPrerequisiteCheckbox(LobbyPrerequisiteCheckboxInfo info)
{

View File

@@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Traits
public class MissionObjectives : INotifyWinStateChanged, ISync, IResolveOrder, IWorldLoaded
{
public readonly MissionObjectivesInfo Info;
readonly List<MissionObjective> objectives = new List<MissionObjective>();
readonly List<MissionObjective> objectives = new();
readonly Player player;
public IReadOnlyList<MissionObjective> Objectives => objectives;

View File

@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits
readonly ModularBotInfo info;
readonly World world;
readonly Queue<Order> orders = new Queue<Order>();
readonly Queue<Order> orders = new();
Player player;

View File

@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly string CannotPlaceTextNotification = null;
[Desc("Hotkey to toggle between PlaceBuildingVariants when placing a structure.")]
public readonly HotkeyReference ToggleVariantKey = new HotkeyReference();
public readonly HotkeyReference ToggleVariantKey = new();
public override object Create(ActorInitializer init) { return new PlaceBuilding(this); }
}

View File

@@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly string CashTickDownNotification = null;
[Desc("Monetary value of each resource type.", "Dictionary of [resource type]: [value per unit].")]
public readonly Dictionary<string, int> ResourceValues = new Dictionary<string, int>();
public readonly Dictionary<string, int> ResourceValues = new();
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
{

View File

@@ -35,11 +35,11 @@ namespace OpenRA.Mods.Common.Traits
public int Experience => experience != null ? experience.Experience : 0;
// Low resolution (every 30 seconds) record of earnings, covering the entire game
public List<int> IncomeSamples = new List<int>(100);
public List<int> IncomeSamples = new(100);
public int Income;
public int DisplayIncome;
public List<int> ArmySamples = new List<int>(100);
public List<int> ArmySamples = new(100);
public int KillsCost;
public int DeathsCost;
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits
public int AssetsValue;
// High resolution (every second) record of earnings, limited to the last minute
readonly Queue<int> earnedSeconds = new Queue<int>(60);
readonly Queue<int> earnedSeconds = new(60);
int lastIncome;
int lastIncomeTick;

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly string Group = null;
[Desc("Only enable this queue for certain factions.")]
public readonly HashSet<string> Factions = new HashSet<string>();
public readonly HashSet<string> Factions = new();
[Desc("Should the prerequisite remain enabled if the owner changes?")]
public readonly bool Sticky = true;
@@ -128,8 +128,8 @@ namespace OpenRA.Mods.Common.Traits
public readonly ProductionQueueInfo Info;
// A list of things we could possibly build
protected readonly Dictionary<ActorInfo, ProductionState> Producible = new Dictionary<ActorInfo, ProductionState>();
protected readonly List<ProductionItem> Queue = new List<ProductionItem>();
protected readonly Dictionary<ActorInfo, ProductionState> Producible = new();
protected readonly List<ProductionItem> Queue = new();
readonly IEnumerable<ActorInfo> allProducibles;
readonly IEnumerable<ActorInfo> buildableProducibles;

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly string[] RequiresPrerequisites = Array.Empty<string>();
[Desc("Only grant this prerequisite for certain factions.")]
public readonly HashSet<string> Factions = new HashSet<string>();
public readonly HashSet<string> Factions = new();
[Desc("Should it recheck everything when it is captured?")]
public readonly bool ResetOnOwnerChange = false;

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
public class TechTree
{
readonly List<Watcher> watchers = new List<Watcher>();
readonly List<Watcher> watchers = new();
public TechTree(ActorInitializer init)
{