Update usages of ! is with is not (#2584)
* Update usages of ! is with is not * Content.IntegrationTests commit * Content.Server commit * Content.Shared commit Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -123,7 +123,7 @@ namespace Content.Shared.Arcade
|
||||
|
||||
public int CompareTo(object? obj)
|
||||
{
|
||||
if (!(obj is HighScoreEntry entry)) return 0;
|
||||
if (obj is not HighScoreEntry entry) return 0;
|
||||
return Score.CompareTo(entry.Score);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace Content.Shared.GameObjects.Components.Body.Part
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
if (!(curState is BodyPartComponentState state))
|
||||
if (curState is not BodyPartComponentState state)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -675,7 +675,7 @@ namespace Content.Shared.GameObjects.Components.Body
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
if (!(curState is BodyComponentState state))
|
||||
if (curState is not BodyComponentState state)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace Content.Shared.GameObjects.Components.Body.Surgery
|
||||
private void RemoveBodyPartSurgery(IBodyPartContainer container, ISurgeon surgeon, IEntity performer)
|
||||
{
|
||||
if (Parent == null) return;
|
||||
if (!(container is IBody body)) return;
|
||||
if (container is not IBody body) return;
|
||||
|
||||
performer.PopupMessage(Loc.GetString("Saw off the limb!"));
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
if (!(curState is SolutionContainerComponentState state))
|
||||
if (curState is not SolutionContainerComponentState state)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,9 @@ namespace Content.Shared.GameObjects.Components.Items
|
||||
|
||||
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
|
||||
{
|
||||
if (!(curState is ItemCooldownComponentState cast))
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
if (curState is not ItemCooldownComponentState cast)
|
||||
return;
|
||||
|
||||
CooldownStart = cast.CooldownStart;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
if (!(curState is CombatModeComponentState state))
|
||||
if (curState is not CombatModeComponentState state)
|
||||
return;
|
||||
|
||||
IsInCombatMode = state.IsInCombatMode;
|
||||
|
||||
@@ -51,7 +51,9 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
|
||||
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
|
||||
{
|
||||
if (!(curState is HumanoidAppearanceComponentState cast))
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
if (curState is not HumanoidAppearanceComponentState cast)
|
||||
return;
|
||||
|
||||
Appearance = cast.Appearance;
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace Content.Shared.GameObjects.Components.Pulling
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
if (!(curState is PullableComponentState state))
|
||||
if (curState is not PullableComponentState state)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -195,7 +195,7 @@ namespace Content.Shared.GameObjects.Components.Pulling
|
||||
{
|
||||
base.HandleMessage(message, component);
|
||||
|
||||
if (!(message is PullMessage pullMessage) ||
|
||||
if (message is not PullMessage pullMessage ||
|
||||
pullMessage.Pulled.Owner != Owner)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Content.Shared.GameObjects.Components.Pulling
|
||||
{
|
||||
base.HandleMessage(message, component);
|
||||
|
||||
if (!(message is PullMessage pullMessage) ||
|
||||
if (message is not PullMessage pullMessage ||
|
||||
pullMessage.Puller.Owner != Owner)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Content.Shared.GameObjects.Components
|
||||
|
||||
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
|
||||
{
|
||||
if (!(curState is StackComponentState cast))
|
||||
if (curState is not StackComponentState cast)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
|
||||
public override bool HandleCmdMessage(ICommonSession? session, InputCmdMessage message)
|
||||
{
|
||||
if (!(message is FullInputCmdMessage full))
|
||||
if (message is not FullInputCmdMessage full)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -219,7 +219,7 @@ namespace Content.Shared.GameObjects.EntitySystems
|
||||
{
|
||||
public override bool HandleCmdMessage(ICommonSession? session, InputCmdMessage message)
|
||||
{
|
||||
if (!(message is FullInputCmdMessage full))
|
||||
if (message is not FullInputCmdMessage full)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace Content.Shared.Preferences
|
||||
|
||||
public bool MemberwiseEquals(ICharacterAppearance maybeOther)
|
||||
{
|
||||
if (!(maybeOther is HumanoidCharacterAppearance other)) return false;
|
||||
if (maybeOther is not HumanoidCharacterAppearance other) return false;
|
||||
if (HairStyleName != other.HairStyleName) return false;
|
||||
if (!HairColor.Equals(other.HairColor)) return false;
|
||||
if (FacialHairStyleName != other.FacialHairStyleName) return false;
|
||||
|
||||
@@ -236,7 +236,7 @@ namespace Content.Shared.Preferences
|
||||
|
||||
public bool MemberwiseEquals(ICharacterProfile maybeOther)
|
||||
{
|
||||
if (!(maybeOther is HumanoidCharacterProfile other)) return false;
|
||||
if (maybeOther is not HumanoidCharacterProfile other) return false;
|
||||
if (Name != other.Name) return false;
|
||||
if (Age != other.Age) return false;
|
||||
if (Sex != other.Sex) return false;
|
||||
|
||||
Reference in New Issue
Block a user