2022-07-25 14:10:18 +12:00
|
|
|
using Content.Shared.Atmos.Prototypes;
|
2020-08-25 16:14:26 +02:00
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
using Robust.Shared.Utility;
|
|
|
|
|
|
2021-06-19 13:25:05 +02:00
|
|
|
namespace Content.Shared.Atmos.EntitySystems
|
2020-08-25 16:14:26 +02:00
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
public abstract class SharedAtmosphereSystem : EntitySystem
|
2020-08-25 16:14:26 +02:00
|
|
|
{
|
|
|
|
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
|
|
|
|
|
2020-11-25 10:48:49 +01:00
|
|
|
protected readonly GasPrototype[] GasPrototypes = new GasPrototype[Atmospherics.TotalNumberOfGases];
|
2020-08-25 16:14:26 +02:00
|
|
|
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < Atmospherics.TotalNumberOfGases; i++)
|
|
|
|
|
{
|
2022-07-25 14:10:18 +12:00
|
|
|
GasPrototypes[i] = _prototypeManager.Index<GasPrototype>(i.ToString());
|
2020-08-25 16:14:26 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GasPrototype GetGas(int gasId) => GasPrototypes[gasId];
|
|
|
|
|
|
|
|
|
|
public GasPrototype GetGas(Gas gasId) => GasPrototypes[(int) gasId];
|
|
|
|
|
|
|
|
|
|
public IEnumerable<GasPrototype> Gases => GasPrototypes;
|
|
|
|
|
}
|
|
|
|
|
}
|