1
0

SharedAtmosDebugOverlaySystem.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Numerics;
  2. using Robust.Shared.Serialization;
  3. namespace Content.Shared.Atmos.EntitySystems
  4. {
  5. public abstract class SharedAtmosDebugOverlaySystem : EntitySystem
  6. {
  7. // Keep in mind, this system is hilariously unoptimized. The goal here is to provide accurate debug data.
  8. public const int LocalViewRange = 16;
  9. protected float AccumulatedFrameTime;
  10. [Serializable, NetSerializable]
  11. public readonly record struct AtmosDebugOverlayData(
  12. Vector2 Indices,
  13. float Temperature,
  14. float[]? Moles,
  15. AtmosDirection PressureDirection,
  16. AtmosDirection LastPressureDirection,
  17. AtmosDirection BlockDirection,
  18. int? InExcitedGroup,
  19. bool IsSpace,
  20. bool MapAtmosphere,
  21. bool NoGrid,
  22. bool Immutable);
  23. /// <summary>
  24. /// Invalid tiles for the gas overlay.
  25. /// No point re-sending every tile if only a subset might have been updated.
  26. /// </summary>
  27. [Serializable, NetSerializable]
  28. public sealed class AtmosDebugOverlayMessage : EntityEventArgs
  29. {
  30. public NetEntity GridId { get; }
  31. public Vector2i BaseIdx { get; }
  32. // LocalViewRange*LocalViewRange
  33. public AtmosDebugOverlayData?[] OverlayData { get; }
  34. public AtmosDebugOverlayMessage(NetEntity gridIndices, Vector2i baseIdx, AtmosDebugOverlayData?[] overlayData)
  35. {
  36. GridId = gridIndices;
  37. BaseIdx = baseIdx;
  38. OverlayData = overlayData;
  39. }
  40. }
  41. [Serializable, NetSerializable]
  42. public sealed class AtmosDebugOverlayDisableMessage : EntityEventArgs
  43. {
  44. }
  45. }
  46. }