1
0

SharedAtmosphereSystem.cs 919 B

1234567891011121314151617181920212223242526272829
  1. using Content.Shared.Atmos.Prototypes;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Utility;
  4. namespace Content.Shared.Atmos.EntitySystems
  5. {
  6. public abstract class SharedAtmosphereSystem : EntitySystem
  7. {
  8. [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
  9. protected readonly GasPrototype[] GasPrototypes = new GasPrototype[Atmospherics.TotalNumberOfGases];
  10. public override void Initialize()
  11. {
  12. base.Initialize();
  13. for (var i = 0; i < Atmospherics.TotalNumberOfGases; i++)
  14. {
  15. GasPrototypes[i] = _prototypeManager.Index<GasPrototype>(i.ToString());
  16. }
  17. }
  18. public GasPrototype GetGas(int gasId) => GasPrototypes[gasId];
  19. public GasPrototype GetGas(Gas gasId) => GasPrototypes[(int) gasId];
  20. public IEnumerable<GasPrototype> Gases => GasPrototypes;
  21. }
  22. }