GasPowerReceiverComponent.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using Content.Shared.Atmos;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  3. namespace Content.Server.Power.Generator;
  4. /// <summary>
  5. /// This is used for providing gas power to machinery.
  6. /// </summary>
  7. [RegisterComponent, Access(typeof(GasPowerReceiverSystem))]
  8. public sealed partial class GasPowerReceiverComponent : Component
  9. {
  10. /// <summary>
  11. /// Past this temperature we assume we're in reaction mass mode and not magic mode.
  12. /// </summary>
  13. [DataField("maxTemperature"), ViewVariables(VVAccess.ReadWrite)]
  14. public float MaxTemperature = 1000.0f;
  15. /// <summary>
  16. /// The gas that fuels this generator
  17. /// </summary>
  18. [DataField("targetGas", required: true), ViewVariables(VVAccess.ReadWrite)]
  19. public Gas TargetGas;
  20. /// <summary>
  21. /// The amount of gas consumed for operation in magic mode.
  22. /// </summary>
  23. [DataField("molesConsumedSec"), ViewVariables(VVAccess.ReadWrite)]
  24. public float MolesConsumedSec = 1.55975875833f / 4;
  25. /// <summary>
  26. /// The amount of kPA "consumed" for operation in pressure mode.
  27. /// </summary>
  28. [DataField("pressureConsumedSec"), ViewVariables(VVAccess.ReadWrite)]
  29. public float PressureConsumedSec = 100f;
  30. /// <summary>
  31. /// Whether the consumed gas should then be ejected directly into the atmosphere.
  32. /// </summary>
  33. [DataField("offVentGas"), ViewVariables(VVAccess.ReadWrite)]
  34. public bool OffVentGas;
  35. [DataField("lastProcess", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
  36. public TimeSpan LastProcess = TimeSpan.Zero;
  37. [DataField("powered"), ViewVariables(VVAccess.ReadWrite)]
  38. public bool Powered = true;
  39. }