* 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
31 lines
678 B
C#
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;
|
|
}
|
|
}
|