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

@@ -413,7 +413,7 @@ namespace OpenRA.Mods.Common.Traits
}
// Add takeoff activity if Aircraft trait is not paused and the actor should not land when idle.
if (ForceLanding && !IsTraitPaused && !cruising && !(self.CurrentActivity is TakeOff))
if (ForceLanding && !IsTraitPaused && !cruising && self.CurrentActivity is not TakeOff)
{
ForceLanding = false;

View File

@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits
if (!h.Key.IsIdle)
{
// Ignore this actor if FindAndDeliverResources is working fine or it is performing a different activity
if (!(h.Key.CurrentActivity is FindAndDeliverResources act) || !act.LastSearchFailed)
if (h.Key.CurrentActivity is not FindAndDeliverResources act || !act.LastSearchFailed)
continue;
}

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
// The DeployTransform order does not have a position associated with it,
// so we can only queue a new transformation if something else has
// already triggered the undeploy.
if (!order.Queued || !(self.CurrentActivity is Transform currentTransform))
if (!order.Queued || self.CurrentActivity is not Transform currentTransform)
return;
currentTransform.Queue(new IssueOrderAfterTransform("DeployTransform", order.Target));

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits
public override void RulesetLoaded(Ruleset rules, ActorInfo ai)
{
var mobileInfo = ai.TraitInfoOrDefault<MobileInfo>();
if (mobileInfo == null || !(mobileInfo.LocomotorInfo is SubterraneanLocomotorInfo))
if (mobileInfo == null || mobileInfo.LocomotorInfo is not SubterraneanLocomotorInfo)
throw new YamlException("GrantConditionOnSubterraneanLayer requires Mobile to be linked to a SubterraneanLocomotor!");
base.RulesetLoaded(rules, ai);

View File

@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits.Render
protected override IEnumerable<IRenderable> RenderSelectionBars(Actor self, WorldRenderer wr, bool displayHealth, bool displayExtra)
{
// Don't render the selection bars for non-selectable actors
if (!(interactable is Selectable) || (!displayHealth && !displayExtra))
if (interactable is not Selectable || (!displayHealth && !displayExtra))
yield break;
var bounds = interactable.DecorationBounds(self, wr);

View File

@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits.Render
if (exitingActor == null)
return;
if (!exitingActor.IsInWorld || exitingActor.Location != openExit || !(exitingActor.CurrentActivity is Mobile.ReturnToCellActivity))
if (!exitingActor.IsInWorld || exitingActor.Location != openExit || exitingActor.CurrentActivity is not Mobile.ReturnToCellActivity)
{
desiredFrame = 0;
exitingActor = null;

View File

@@ -159,7 +159,7 @@ namespace OpenRA.Mods.Common.Traits
IEnumerable<IRenderable> ITiledTerrainRenderer.RenderUIPreview(WorldRenderer wr, TerrainTemplateInfo t, int2 origin, float scale)
{
if (!(t is DefaultTerrainTemplateInfo template))
if (t is not DefaultTerrainTemplateInfo template)
yield break;
var ts = map.Grid.TileSize;
@@ -187,7 +187,7 @@ namespace OpenRA.Mods.Common.Traits
IEnumerable<IRenderable> ITiledTerrainRenderer.RenderPreview(WorldRenderer wr, TerrainTemplateInfo t, WPos origin)
{
if (!(t is DefaultTerrainTemplateInfo template))
if (t is not DefaultTerrainTemplateInfo template)
yield break;
var i = 0;