TileChangedEvent bool (#5089)

Shows whether IsEmpty is different, useful in circumstances.

Also NotNullWhen null handling consistency.
This commit is contained in:
metalgearsloth
2024-05-01 00:28:29 +10:00
committed by GitHub
parent ccba6b5d1c
commit 5a14e939bf
2 changed files with 6 additions and 1 deletions

View File

@@ -1523,7 +1523,7 @@ namespace Robust.Shared.GameObjects
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[Pure]
public bool TryComp(EntityUid? uid, [NotNullWhen(true)] out TComp1? component)
public bool TryComp([NotNullWhen(true)] EntityUid? uid, [NotNullWhen(true)] out TComp1? component)
=> TryGetComponent(uid, out component);
[MethodImpl(MethodImplOptions.AggressiveInlining)]

View File

@@ -145,6 +145,11 @@ namespace Robust.Shared.GameObjects
ChunkIndex = chunkIndex;
}
/// <summary>
/// Was the tile previously empty or is it now empty.
/// </summary>
public bool EmptyChanged => OldTile.IsEmpty != NewTile.Tile.IsEmpty;
/// <summary>
/// EntityUid of the grid with the tile-change. TileRef stores the GridId.
/// </summary>