1
0

GridAtmosphereComponent.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using Content.Server.Atmos.EntitySystems;
  2. using Content.Server.Atmos.Piping.Components;
  3. using Content.Server.Atmos.Serialization;
  4. using Content.Server.NodeContainer.NodeGroups;
  5. namespace Content.Server.Atmos.Components
  6. {
  7. /// <summary>
  8. /// Internal Atmos class. Use <see cref="AtmosphereSystem"/> to interact with atmos instead.
  9. /// </summary>
  10. [RegisterComponent, Serializable,
  11. Access(typeof(AtmosphereSystem), typeof(GasTileOverlaySystem), typeof(AtmosDebugOverlaySystem))]
  12. public sealed partial class GridAtmosphereComponent : Component
  13. {
  14. [ViewVariables(VVAccess.ReadWrite)]
  15. public bool Simulated { get; set; } = true;
  16. [ViewVariables]
  17. public bool ProcessingPaused { get; set; } = false;
  18. [ViewVariables]
  19. public float Timer { get; set; } = 0f;
  20. [ViewVariables]
  21. public int UpdateCounter { get; set; } = 1; // DO NOT SET TO ZERO BY DEFAULT! It will break roundstart atmos...
  22. [ViewVariables]
  23. [IncludeDataField(customTypeSerializer:typeof(TileAtmosCollectionSerializer))]
  24. public Dictionary<Vector2i, TileAtmosphere> Tiles = new(1000);
  25. [ViewVariables]
  26. public HashSet<TileAtmosphere> MapTiles = new(1000);
  27. [ViewVariables]
  28. public readonly HashSet<TileAtmosphere> ActiveTiles = new(1000);
  29. [ViewVariables]
  30. public int ActiveTilesCount => ActiveTiles.Count;
  31. [ViewVariables]
  32. public readonly HashSet<ExcitedGroup> ExcitedGroups = new(1000);
  33. [ViewVariables]
  34. public int ExcitedGroupCount => ExcitedGroups.Count;
  35. [ViewVariables]
  36. public readonly HashSet<TileAtmosphere> HotspotTiles = new(1000);
  37. [ViewVariables]
  38. public int HotspotTilesCount => HotspotTiles.Count;
  39. [ViewVariables]
  40. public readonly HashSet<TileAtmosphere> SuperconductivityTiles = new(1000);
  41. [ViewVariables]
  42. public int SuperconductivityTilesCount => SuperconductivityTiles.Count;
  43. [ViewVariables]
  44. public HashSet<TileAtmosphere> HighPressureDelta = new(1000);
  45. [ViewVariables]
  46. public int HighPressureDeltaCount => HighPressureDelta.Count;
  47. [ViewVariables]
  48. public readonly HashSet<IPipeNet> PipeNets = new();
  49. [ViewVariables]
  50. public readonly HashSet<Entity<AtmosDeviceComponent>> AtmosDevices = new();
  51. [ViewVariables]
  52. public readonly Queue<TileAtmosphere> CurrentRunTiles = new();
  53. [ViewVariables]
  54. public readonly Queue<ExcitedGroup> CurrentRunExcitedGroups = new();
  55. [ViewVariables]
  56. public readonly Queue<IPipeNet> CurrentRunPipeNet = new();
  57. [ViewVariables]
  58. public readonly Queue<Entity<AtmosDeviceComponent>> CurrentRunAtmosDevices = new();
  59. [ViewVariables]
  60. public readonly HashSet<Vector2i> InvalidatedCoords = new(1000);
  61. [ViewVariables]
  62. public readonly Queue<TileAtmosphere> CurrentRunInvalidatedTiles = new();
  63. [ViewVariables]
  64. public readonly List<TileAtmosphere> PossiblyDisconnectedTiles = new(100);
  65. [ViewVariables]
  66. public int InvalidatedCoordsCount => InvalidatedCoords.Count;
  67. [ViewVariables]
  68. public long EqualizationQueueCycleControl { get; set; }
  69. [ViewVariables]
  70. public AtmosphereProcessingState State { get; set; } = AtmosphereProcessingState.Revalidate;
  71. }
  72. }