Better nullability for GridAtmosphereComponent
This commit is contained in:
@@ -4,7 +4,6 @@ using System.Collections.Generic;
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Content.Server.Atmos.Reactions;
|
using Content.Server.Atmos.Reactions;
|
||||||
using Content.Server.GameObjects.Components.Atmos;
|
using Content.Server.GameObjects.Components.Atmos;
|
||||||
using Content.Server.GameObjects.EntitySystems.Atmos;
|
|
||||||
using Content.Server.Interfaces;
|
using Content.Server.Interfaces;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
@@ -14,7 +13,6 @@ using JetBrains.Annotations;
|
|||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
using Robust.Server.GameObjects.EntitySystems.TileLookup;
|
using Robust.Server.GameObjects.EntitySystems.TileLookup;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.GameObjects.Components;
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Content.Server.Atmos;
|
using Content.Server.Atmos;
|
||||||
@@ -264,7 +265,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
var direction = (AtmosDirection) (1 << i);
|
var direction = (AtmosDirection) (1 << i);
|
||||||
var otherIndices = indices.Offset(direction.ToDirection());
|
var otherIndices = indices.Offset(direction.ToDirection());
|
||||||
var otherTile = GetTile(otherIndices);
|
var otherTile = GetTile(otherIndices);
|
||||||
AddActiveTile(otherTile);
|
if (otherTile != null) AddActiveTile(otherTile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,7 +299,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public virtual void AddActiveTile(TileAtmosphere? tile)
|
public virtual void AddActiveTile(TileAtmosphere tile)
|
||||||
{
|
{
|
||||||
if (tile?.GridIndex != _gridId) return;
|
if (tile?.GridIndex != _gridId) return;
|
||||||
tile.Excited = true;
|
tile.Excited = true;
|
||||||
@@ -307,9 +308,8 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public virtual void RemoveActiveTile(TileAtmosphere? tile, bool disposeGroup = true)
|
public virtual void RemoveActiveTile(TileAtmosphere tile, bool disposeGroup = true)
|
||||||
{
|
{
|
||||||
if (tile == null) return;
|
|
||||||
_activeTiles.Remove(tile);
|
_activeTiles.Remove(tile);
|
||||||
tile.Excited = false;
|
tile.Excited = false;
|
||||||
if(disposeGroup)
|
if(disposeGroup)
|
||||||
@@ -320,7 +320,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public virtual void AddHotspotTile(TileAtmosphere? tile)
|
public virtual void AddHotspotTile(TileAtmosphere tile)
|
||||||
{
|
{
|
||||||
if (tile?.GridIndex != _gridId || tile?.Air == null) return;
|
if (tile?.GridIndex != _gridId || tile?.Air == null) return;
|
||||||
_hotspotTiles.Add(tile);
|
_hotspotTiles.Add(tile);
|
||||||
@@ -328,29 +328,27 @@ namespace Content.Server.GameObjects.Components.Atmos
|
|||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public virtual void RemoveHotspotTile(TileAtmosphere? tile)
|
public virtual void RemoveHotspotTile(TileAtmosphere tile)
|
||||||
{
|
{
|
||||||
if (tile == null) return;
|
|
||||||
_hotspotTiles.Remove(tile);
|
_hotspotTiles.Remove(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void AddSuperconductivityTile(TileAtmosphere? tile)
|
public virtual void AddSuperconductivityTile(TileAtmosphere tile)
|
||||||
{
|
{
|
||||||
if (tile?.GridIndex != _gridId) return;
|
if (tile?.GridIndex != _gridId) return;
|
||||||
_superconductivityTiles.Add(tile);
|
_superconductivityTiles.Add(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void RemoveSuperconductivityTile(TileAtmosphere? tile)
|
public virtual void RemoveSuperconductivityTile(TileAtmosphere tile)
|
||||||
{
|
{
|
||||||
if (tile == null) return;
|
|
||||||
_superconductivityTiles.Remove(tile);
|
_superconductivityTiles.Remove(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public virtual void AddHighPressureDelta(TileAtmosphere? tile)
|
public virtual void AddHighPressureDelta(TileAtmosphere tile)
|
||||||
{
|
{
|
||||||
if (tile?.GridIndex != _gridId) return;
|
if (tile.GridIndex != _gridId) return;
|
||||||
_highPressureDelta.Add(tile);
|
_highPressureDelta.Add(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user