Fix IDE0028, IDE0300, IDE0301, IDE0302, IDE0303, IDE0304.
Silence IDE0305.
This commit is contained in:
committed by
Pavel Penev
parent
0740991c12
commit
79454d8fd2
@@ -78,11 +78,11 @@ namespace OpenRA
|
||||
public readonly MiniYaml LoadScreen;
|
||||
public readonly string DefaultOrderGenerator;
|
||||
|
||||
public readonly string[] Assemblies = Array.Empty<string>();
|
||||
public readonly string[] SoundFormats = Array.Empty<string>();
|
||||
public readonly string[] SpriteFormats = Array.Empty<string>();
|
||||
public readonly string[] PackageFormats = Array.Empty<string>();
|
||||
public readonly string[] VideoFormats = Array.Empty<string>();
|
||||
public readonly string[] Assemblies = [];
|
||||
public readonly string[] SoundFormats = [];
|
||||
public readonly string[] SpriteFormats = [];
|
||||
public readonly string[] PackageFormats = [];
|
||||
public readonly string[] VideoFormats = [];
|
||||
public readonly int FontSheetSize = 512;
|
||||
public readonly int CursorSheetSize = 512;
|
||||
|
||||
@@ -91,15 +91,15 @@ namespace OpenRA
|
||||
public readonly bool AllowUnusedFluentMessagesInExternalPackages = true;
|
||||
|
||||
readonly string[] reservedModuleNames =
|
||||
{
|
||||
[
|
||||
"Include", "Metadata", "FileSystem", "MapFolders", "Rules",
|
||||
"Sequences", "ModelSequences", "Cursors", "Chrome", "Assemblies", "ChromeLayout", "Weapons",
|
||||
"Voices", "Notifications", "Music", "FluentMessages", "TileSets", "ChromeMetrics", "Missions", "Hotkeys",
|
||||
"ServerTraits", "LoadScreen", "DefaultOrderGenerator", "SupportsMapsFrom", "SoundFormats", "SpriteFormats", "VideoFormats",
|
||||
"RequiresMods", "PackageFormats", "AllowUnusedFluentMessagesInExternalPackages", "FontSheetSize", "CursorSheetSize"
|
||||
};
|
||||
];
|
||||
|
||||
readonly TypeDictionary modules = new();
|
||||
readonly TypeDictionary modules = [];
|
||||
readonly Dictionary<string, MiniYaml> yaml;
|
||||
|
||||
bool customDataLoaded;
|
||||
@@ -127,7 +127,7 @@ namespace OpenRA
|
||||
}
|
||||
|
||||
// Merge inherited overrides
|
||||
yaml = new MiniYaml(null, MiniYaml.Merge(new[] { nodes })).ToDictionary();
|
||||
yaml = new MiniYaml(null, MiniYaml.Merge([nodes])).ToDictionary();
|
||||
|
||||
Metadata = FieldLoader.Load<ModMetadata>(yaml["Metadata"]);
|
||||
|
||||
@@ -207,11 +207,11 @@ namespace OpenRA
|
||||
throw new InvalidDataException($"`{kv.Key}` is not a valid mod manifest entry.");
|
||||
|
||||
IGlobalModData module;
|
||||
var ctor = t.GetConstructor(new[] { typeof(MiniYaml) });
|
||||
var ctor = t.GetConstructor([typeof(MiniYaml)]);
|
||||
if (ctor != null)
|
||||
{
|
||||
// Class has opted-in to DIY initialization
|
||||
module = (IGlobalModData)ctor.Invoke(new object[] { kv.Value });
|
||||
module = (IGlobalModData)ctor.Invoke([kv.Value]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -229,7 +229,7 @@ namespace OpenRA
|
||||
static string[] YamlList(Dictionary<string, MiniYaml> yaml, string key)
|
||||
{
|
||||
if (!yaml.TryGetValue(key, out var value))
|
||||
return Array.Empty<string>();
|
||||
return [];
|
||||
|
||||
return value.Nodes.Select(n => n.Key).ToArray();
|
||||
}
|
||||
@@ -279,11 +279,11 @@ namespace OpenRA
|
||||
}
|
||||
|
||||
IGlobalModData module;
|
||||
var ctor = t.GetConstructor(new[] { typeof(MiniYaml) });
|
||||
var ctor = t.GetConstructor([typeof(MiniYaml)]);
|
||||
if (ctor != null)
|
||||
{
|
||||
// Class has opted-in to DIY initialization
|
||||
module = (IGlobalModData)ctor.Invoke(new object[] { data.Value });
|
||||
module = (IGlobalModData)ctor.Invoke([data.Value]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user