2023-12-15 17:18:00 -05:00
|
|
|
using System.Numerics;
|
2021-06-19 13:25:05 +02:00
|
|
|
using Robust.Shared.Serialization;
|
2020-09-21 00:13:17 +01:00
|
|
|
|
2021-06-19 13:25:05 +02:00
|
|
|
namespace Content.Shared.Atmos.EntitySystems
|
2020-09-21 00:13:17 +01:00
|
|
|
{
|
|
|
|
|
public abstract class SharedAtmosDebugOverlaySystem : EntitySystem
|
|
|
|
|
{
|
|
|
|
|
// Keep in mind, this system is hilariously unoptimized. The goal here is to provide accurate debug data.
|
|
|
|
|
public const int LocalViewRange = 16;
|
|
|
|
|
protected float AccumulatedFrameTime;
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2023-12-15 17:18:00 -05:00
|
|
|
public readonly record struct AtmosDebugOverlayData(
|
|
|
|
|
Vector2 Indices,
|
|
|
|
|
float Temperature,
|
|
|
|
|
float[]? Moles,
|
|
|
|
|
AtmosDirection PressureDirection,
|
|
|
|
|
AtmosDirection LastPressureDirection,
|
|
|
|
|
AtmosDirection BlockDirection,
|
|
|
|
|
int? InExcitedGroup,
|
|
|
|
|
bool IsSpace,
|
|
|
|
|
bool MapAtmosphere,
|
2024-03-25 03:17:56 +11:00
|
|
|
bool NoGrid,
|
|
|
|
|
bool Immutable);
|
2020-09-21 00:13:17 +01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Invalid tiles for the gas overlay.
|
|
|
|
|
/// No point re-sending every tile if only a subset might have been updated.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable, NetSerializable]
|
2021-03-09 11:22:48 -08:00
|
|
|
public sealed class AtmosDebugOverlayMessage : EntityEventArgs
|
2020-09-21 00:13:17 +01:00
|
|
|
{
|
2023-09-11 09:42:41 +10:00
|
|
|
public NetEntity GridId { get; }
|
2020-09-21 00:13:17 +01:00
|
|
|
|
2020-10-11 15:21:21 +02:00
|
|
|
public Vector2i BaseIdx { get; }
|
2020-09-21 00:13:17 +01:00
|
|
|
// LocalViewRange*LocalViewRange
|
2023-12-15 17:18:00 -05:00
|
|
|
public AtmosDebugOverlayData?[] OverlayData { get; }
|
2020-09-21 00:13:17 +01:00
|
|
|
|
2023-12-15 17:18:00 -05:00
|
|
|
public AtmosDebugOverlayMessage(NetEntity gridIndices, Vector2i baseIdx, AtmosDebugOverlayData?[] overlayData)
|
2020-09-21 00:13:17 +01:00
|
|
|
{
|
|
|
|
|
GridId = gridIndices;
|
|
|
|
|
BaseIdx = baseIdx;
|
|
|
|
|
OverlayData = overlayData;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-18 08:18:04 +01:00
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2021-03-09 11:22:48 -08:00
|
|
|
public sealed class AtmosDebugOverlayDisableMessage : EntityEventArgs
|
2020-11-18 08:18:04 +01:00
|
|
|
{
|
|
|
|
|
}
|
2020-09-21 00:13:17 +01:00
|
|
|
}
|
|
|
|
|
}
|