1
0

SharedGasCanisterComponent.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using Robust.Shared.Serialization;
  2. namespace Content.Shared.Atmos.Piping.Binary.Components
  3. {
  4. /// <summary>
  5. /// Key representing which <see cref="PlayerBoundUserInterface"/> is currently open.
  6. /// Useful when there are multiple UI for an object. Here it's future-proofing only.
  7. /// </summary>
  8. [Serializable, NetSerializable]
  9. public enum GasCanisterUiKey
  10. {
  11. Key,
  12. }
  13. #region Enums
  14. /// <summary>
  15. /// Used in <see cref="GasCanisterVisualizer"/> to determine which visuals to update.
  16. /// </summary>
  17. [Serializable, NetSerializable]
  18. public enum GasCanisterVisuals
  19. {
  20. PressureState,
  21. TankInserted
  22. }
  23. #endregion
  24. /// <summary>
  25. /// Represents a <see cref="GasCanisterComponent"/> state that can be sent to the client
  26. /// </summary>
  27. [Serializable, NetSerializable]
  28. public sealed class GasCanisterBoundUserInterfaceState : BoundUserInterfaceState
  29. {
  30. public string CanisterLabel { get; }
  31. public float CanisterPressure { get; }
  32. public bool PortStatus { get; }
  33. public string? TankLabel { get; }
  34. public float TankPressure { get; }
  35. public float ReleasePressure { get; }
  36. public bool ReleaseValve { get; }
  37. public float ReleasePressureMin { get; }
  38. public float ReleasePressureMax { get; }
  39. public GasCanisterBoundUserInterfaceState(string canisterLabel, float canisterPressure, bool portStatus, string? tankLabel, float tankPressure, float releasePressure, bool releaseValve, float releaseValveMin, float releaseValveMax)
  40. {
  41. CanisterLabel = canisterLabel;
  42. CanisterPressure = canisterPressure;
  43. PortStatus = portStatus;
  44. TankLabel = tankLabel;
  45. TankPressure = tankPressure;
  46. ReleasePressure = releasePressure;
  47. ReleaseValve = releaseValve;
  48. ReleasePressureMin = releaseValveMin;
  49. ReleasePressureMax = releaseValveMax;
  50. }
  51. }
  52. [Serializable, NetSerializable]
  53. public sealed class GasCanisterHoldingTankEjectMessage : BoundUserInterfaceMessage
  54. {
  55. public GasCanisterHoldingTankEjectMessage()
  56. {}
  57. }
  58. [Serializable, NetSerializable]
  59. public sealed class GasCanisterChangeReleasePressureMessage : BoundUserInterfaceMessage
  60. {
  61. public float Pressure { get; }
  62. public GasCanisterChangeReleasePressureMessage(float pressure)
  63. {
  64. Pressure = pressure;
  65. }
  66. }
  67. [Serializable, NetSerializable]
  68. public sealed class GasCanisterChangeReleaseValveMessage : BoundUserInterfaceMessage
  69. {
  70. public bool Valve { get; }
  71. public GasCanisterChangeReleaseValveMessage(bool valve)
  72. {
  73. Valve = valve;
  74. }
  75. }
  76. }