| 1234567891011121314151617181920212223242526272829 |
- using Content.Shared.Atmos.Prototypes;
- using Robust.Shared.Prototypes;
- using Robust.Shared.Utility;
- namespace Content.Shared.Atmos.EntitySystems
- {
- public abstract class SharedAtmosphereSystem : EntitySystem
- {
- [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
- protected readonly GasPrototype[] GasPrototypes = new GasPrototype[Atmospherics.TotalNumberOfGases];
- public override void Initialize()
- {
- base.Initialize();
- for (var i = 0; i < Atmospherics.TotalNumberOfGases; i++)
- {
- GasPrototypes[i] = _prototypeManager.Index<GasPrototype>(i.ToString());
- }
- }
- public GasPrototype GetGas(int gasId) => GasPrototypes[gasId];
- public GasPrototype GetGas(Gas gasId) => GasPrototypes[(int) gasId];
- public IEnumerable<GasPrototype> Gases => GasPrototypes;
- }
- }
|