Fix IDE0028, IDE0300, IDE0301, IDE0302, IDE0303, IDE0304.

Silence IDE0305.
This commit is contained in:
RoosterDragon
2025-03-03 17:29:45 +00:00
committed by Pavel Penev
parent 0740991c12
commit 79454d8fd2
559 changed files with 1661 additions and 1751 deletions

View File

@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
readonly Widget actorEditPanel;
readonly LabelWidget typeLabel;
readonly TextFieldWidget actorIDField;
readonly HashSet<TextFieldWidget> typableFields = new();
readonly HashSet<TextFieldWidget> typableFields = [];
readonly LabelWidget actorIDErrorLabel;
readonly Widget initContainer;
@@ -485,7 +485,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
sealed class EditActorPreview
{
readonly SetActorIdAction setActorIdAction;
readonly List<IEditActorHandle> handles = new();
readonly List<IEditActorHandle> handles = [];
EditorActorPreview actor;
public EditActorPreview(ActorEditLogic logic, EditorViewportControllerWidget editor, EditorActorLayer editorActorLayer, EditorActorPreview actor)

View File

@@ -40,8 +40,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
protected readonly ScrollPanelWidget Panel;
protected readonly ScrollItemWidget ItemTemplate;
protected readonly HashSet<string> SelectedCategories = new();
protected readonly List<string> FilteredCategories = new();
protected readonly HashSet<string> SelectedCategories = [];
protected readonly List<string> FilteredCategories = [];
protected string[] allCategories;
protected string searchFilter;
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
protected Widget CreateCategoriesPanel(ScrollPanelWidget panel)
{
var categoriesPanel = Ui.LoadWidget("CATEGORY_FILTER_PANEL", null, new WidgetArgs());
var categoriesPanel = Ui.LoadWidget("CATEGORY_FILTER_PANEL", null, []);
var categoryTemplate = categoriesPanel.Get<CheckboxWidget>("CATEGORY_TEMPLATE");
var selectButtons = categoriesPanel.Get<ContainerWidget>("SELECT_CATEGORIES_BUTTONS");

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
readonly EditorActionManager editorActionManager;
readonly ScrollItemWidget template;
readonly Dictionary<EditorActionContainer, ScrollItemWidget> states = new();
readonly Dictionary<EditorActionContainer, ScrollItemWidget> states = [];
[ObjectCreator.UseCtor]
public HistoryLogLogic(Widget widget, World world)

View File

@@ -61,8 +61,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
this.modData = modData;
selectedGenerator = null;
generatorsToSettings = new Dictionary<IMapGeneratorInfo, MapGeneratorSettings>();
generatorsToSettingsChoices = new Dictionary<IMapGeneratorInfo, Dictionary<MapGeneratorSettings.Option, MapGeneratorSettings.Choice>>();
generatorsToSettings = [];
generatorsToSettingsChoices = [];
var mapGenerators = new List<IMapGeneratorInfo>();
var terrainInfo = modData.DefaultTerrainInfo[world.Map.Tileset];

View File

@@ -95,10 +95,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Widget CreateOverlaysPanel()
{
var categoriesPanel = Ui.LoadWidget("OVERLAY_PANEL", null, new WidgetArgs());
var categoriesPanel = Ui.LoadWidget("OVERLAY_PANEL", null, []);
var categoryTemplate = categoriesPanel.Get<CheckboxWidget>("CATEGORY_TEMPLATE");
MapOverlays[] allCategories = { MapOverlays.Grid, MapOverlays.Buildable, MapOverlays.Marker };
MapOverlays[] allCategories = [MapOverlays.Grid, MapOverlays.Buildable, MapOverlays.Marker];
foreach (var cat in allCategories)
{
var category = categoryTemplate.Clone();

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{ MapTool.MapGenerator, MapGenerator }
};
readonly Dictionary<MapTool, Widget> toolPanels = new();
readonly Dictionary<MapTool, Widget> toolPanels = [];
MapTool selectedTool = MapTool.MarkerTiles;

View File

@@ -87,7 +87,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var author = widget.Get<TextFieldWidget>("AUTHOR");
author.Text = map.Author;
var visibilityPanel = Ui.LoadWidget("MAP_SAVE_VISIBILITY_PANEL", null, new WidgetArgs());
var visibilityPanel = Ui.LoadWidget("MAP_SAVE_VISIBILITY_PANEL", null, []);
var visOptionTemplate = visibilityPanel.Get<CheckboxWidget>("VISIBILITY_TEMPLATE");
visibilityPanel.RemoveChildren();

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Template = template;
Categories = template.Categories;
Tooltip = template.Id.ToString(NumberFormatInfo.CurrentInfo);
SearchTerms = new[] { Tooltip };
SearchTerms = [Tooltip];
}
}