Fix IDE0083

This commit is contained in:
RoosterDragon
2023-04-05 19:27:14 +01:00
committed by Pavel Penev
parent bd2b3d9793
commit 164abfdae1
37 changed files with 41 additions and 41 deletions

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var disconnected = false;
widget.Get<LogicTickerWidget>("DISCONNECT_WATCHER").OnTick = () =>
{
if (!(orderManager.Connection is NetworkConnection connection))
if (orderManager.Connection is not NetworkConnection connection)
return;
if (disconnected || connection.ConnectionState != ConnectionState.NotConnected)

View File

@@ -126,7 +126,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
foreach (var kv in modData.MapCache.MapLocations)
{
if (!(kv.Key is Folder folder))
if (kv.Key is not Folder folder)
continue;
try
@@ -209,7 +209,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
try
{
if (!(map.Package is IReadWritePackage package) || package.Name != combinedPath)
if (map.Package is not IReadWritePackage package || package.Name != combinedPath)
{
selectedDirectory.Folder.Delete(combinedPath);
if (fileType == MapFileType.OraMap)

View File

@@ -276,7 +276,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
games[games.IndexOf(oldPath)] = newPath;
foreach (var c in gameList.Children)
{
if (!(c is ScrollItemWidget item) || item.ItemKey != oldPath)
if (c is not ScrollItemWidget item || item.ItemKey != oldPath)
continue;
item.ItemKey = newPath;

View File

@@ -133,7 +133,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
// Select the first active tab
foreach (var b in typesContainer.Children)
{
if (!(b is ProductionTypeButtonWidget button) || button.IsDisabled())
if (b is not ProductionTypeButtonWidget button || button.IsDisabled())
continue;
button.OnClick();

View File

@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Widgets
forceAttackButton.IsDisabled = () => { UpdateStateIfNecessary(); return forceAttackDisabled; };
forceAttackButton.IsHighlighted = () => !forceAttackButton.IsDisabled() && IsForceModifiersActive(Modifiers.Ctrl)
&& !(world.OrderGenerator is AttackMoveOrderGenerator);
&& world.OrderGenerator is not AttackMoveOrderGenerator;
forceAttackButton.OnClick = () =>
{

View File

@@ -122,7 +122,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
};
}
foreach (var option in allOptions.Where(o => !(o is LobbyBooleanOption)))
foreach (var option in allOptions.Where(o => o is not LobbyBooleanOption))
{
if (dropdownColumns.Count == 0)
{