Files
tbd-station-14/Content.Server/Atmos/TileMixtureEnumerator.cs
Jezithyr 6869adfa78 Move GasMixture to shared (#27480)
* Moved GasMixture to shared

* Temp Fix for sandbox violation, idk why Array.Resize isn't working properly. It's already sandboxed.

* The most powerful webedit in history
2024-04-30 14:31:05 -07:00

31 lines
678 B
C#

using System.Diagnostics.CodeAnalysis;
using Content.Shared.Atmos;
namespace Content.Server.Atmos;
public struct TileMixtureEnumerator
{
public readonly TileAtmosphere?[] Tiles;
public int Index = 0;
public static readonly TileMixtureEnumerator Empty = new(Array.Empty<TileAtmosphere>());
internal TileMixtureEnumerator(TileAtmosphere?[] tiles)
{
Tiles = tiles;
}
public bool MoveNext([NotNullWhen(true)] out GasMixture? mix)
{
while (Index < Tiles.Length)
{
mix = Tiles[Index++]?.Air;
if (mix != null)
return true;
}
mix = null;
return false;
}
}