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:
@@ -119,7 +119,7 @@ namespace Content.Server.GameObjects.Components.Arcade
|
||||
if (!Powered)
|
||||
return;
|
||||
|
||||
if (!(serverMsg.Message is SpaceVillainArcadePlayerActionMessage msg)) return;
|
||||
if (serverMsg.Message is not SpaceVillainArcadePlayerActionMessage msg) return;
|
||||
|
||||
switch (msg.PlayerAction)
|
||||
{
|
||||
|
||||
@@ -381,7 +381,7 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(obj.Message is UiButtonPressedMessage message))
|
||||
if (obj.Message is not UiButtonPressedMessage message)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -415,7 +415,7 @@ namespace Content.Server.GameObjects.Components.GUI
|
||||
// make sure this is one of our containers.
|
||||
// Technically the correct way would be to enumerate the possible slot names
|
||||
// comparing with this container, but I might as well put the dictionary to good use.
|
||||
if (!(container is ContainerSlot slot) || !_slotContainers.ContainsValue(slot))
|
||||
if (container is not ContainerSlot slot || !_slotContainers.ContainsValue(slot))
|
||||
return;
|
||||
|
||||
if (entity.TryGetComponent(out ItemComponent itemComp))
|
||||
|
||||
@@ -411,7 +411,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
}
|
||||
case CloseStorageUIMessage _:
|
||||
{
|
||||
if (!(session is IPlayerSession playerSession))
|
||||
if (session is not IPlayerSession playerSession)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace Content.Server.GameObjects.Components.Medical
|
||||
|
||||
private void OnUiReceiveMessage(ServerBoundUserInterfaceMessage obj)
|
||||
{
|
||||
if (!(obj.Message is CloningPodUiButtonPressedMessage message)) return;
|
||||
if (obj.Message is not CloningPodUiButtonPressedMessage message) return;
|
||||
|
||||
switch (message.Button)
|
||||
{
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace Content.Server.GameObjects.Components.Medical
|
||||
|
||||
private void OnUiReceiveMessage(ServerBoundUserInterfaceMessage obj)
|
||||
{
|
||||
if (!(obj.Message is UiButtonPressedMessage message)) return;
|
||||
if (obj.Message is not UiButtonPressedMessage message) return;
|
||||
|
||||
switch (message.Button)
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Content.Server.GameObjects.Components.Mobs
|
||||
|
||||
private void OnUiAcceptCloningMessage(ServerBoundUserInterfaceMessage obj)
|
||||
{
|
||||
if (!(obj.Message is SharedAcceptCloningComponent.UiButtonPressedMessage message)) return;
|
||||
if (obj.Message is not SharedAcceptCloningComponent.UiButtonPressedMessage) return;
|
||||
if (Mind != null)
|
||||
{
|
||||
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new GhostComponent.GhostReturnMessage(Mind));
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
|
||||
protected override void OnAddNode(Node node)
|
||||
{
|
||||
if (!(node is PipeNode pipeNode))
|
||||
if (node is not PipeNode pipeNode)
|
||||
return;
|
||||
_pipes.Add(pipeNode);
|
||||
pipeNode.JoinPipeNet(this);
|
||||
@@ -58,7 +58,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
protected override void OnRemoveNode(Node node)
|
||||
{
|
||||
RemoveFromGridAtmos();
|
||||
if (!(node is PipeNode pipeNode))
|
||||
if (node is not PipeNode pipeNode)
|
||||
return;
|
||||
var pipeAir = pipeNode.LocalAir;
|
||||
pipeAir.Merge(Air);
|
||||
@@ -68,7 +68,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
|
||||
protected override void OnGivingNodesForCombine(INodeGroup newGroup)
|
||||
{
|
||||
if (!(newGroup is IPipeNet newPipeNet))
|
||||
if (newGroup is not IPipeNet newPipeNet)
|
||||
return;
|
||||
newPipeNet.Air.Merge(Air);
|
||||
Air.Clear();
|
||||
@@ -78,7 +78,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups
|
||||
{
|
||||
foreach (var newGroup in newGroups)
|
||||
{
|
||||
if (!(newGroup is IPipeNet newPipeNet))
|
||||
if (newGroup is not IPipeNet newPipeNet)
|
||||
continue;
|
||||
newPipeNet.Air.Merge(Air);
|
||||
var newPipeNetGas = newPipeNet.Air;
|
||||
|
||||
@@ -215,8 +215,8 @@ namespace Content.Server.GameObjects.Components.Suspicion
|
||||
{
|
||||
base.HandleMessage(message, component);
|
||||
|
||||
if (!(message is RoleMessage msg) ||
|
||||
!(msg.Role is SuspicionRole role))
|
||||
if (message is not RoleMessage msg ||
|
||||
msg.Role is not SuspicionRole role)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user