GasMinerComponent.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using Robust.Shared.Serialization;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.Atmos.Components;
  4. [NetworkedComponent]
  5. [AutoGenerateComponentState]
  6. [RegisterComponent]
  7. public sealed partial class GasMinerComponent : Component
  8. {
  9. /// <summary>
  10. /// Operational state of the miner.
  11. /// </summary>
  12. [AutoNetworkedField]
  13. [ViewVariables(VVAccess.ReadOnly)]
  14. public GasMinerState MinerState = GasMinerState.Disabled;
  15. /// <summary>
  16. /// If the number of moles in the external environment exceeds this number, no gas will be mined.
  17. /// </summary>
  18. [ViewVariables(VVAccess.ReadWrite)]
  19. [DataField]
  20. public float MaxExternalAmount = float.PositiveInfinity;
  21. /// <summary>
  22. /// If the pressure (in kPA) of the external environment exceeds this number, no gas will be mined.
  23. /// </summary>
  24. [ViewVariables(VVAccess.ReadWrite)]
  25. [DataField]
  26. public float MaxExternalPressure = Atmospherics.GasMinerDefaultMaxExternalPressure;
  27. /// <summary>
  28. /// Gas to spawn.
  29. /// </summary>
  30. [ViewVariables(VVAccess.ReadWrite)]
  31. [DataField(required: true)]
  32. public Gas SpawnGas;
  33. /// <summary>
  34. /// Temperature in Kelvin.
  35. /// </summary>
  36. [ViewVariables(VVAccess.ReadWrite)]
  37. [DataField]
  38. public float SpawnTemperature = Atmospherics.T20C;
  39. /// <summary>
  40. /// Number of moles created per second when the miner is working.
  41. /// </summary>
  42. [ViewVariables(VVAccess.ReadWrite)]
  43. [DataField]
  44. public float SpawnAmount = Atmospherics.MolesCellStandard * 20f;
  45. }
  46. [Serializable, NetSerializable]
  47. public enum GasMinerState : byte
  48. {
  49. Disabled,
  50. Idle,
  51. Working,
  52. }