2021-07-17 02:37:09 +02:00
|
|
|
|
using System;
|
2020-09-21 00:13:17 +01:00
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
using Robust.Shared.Map;
|
2020-10-11 15:21:21 +02:00
|
|
|
|
using Robust.Shared.Maths;
|
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]
|
|
|
|
|
|
public readonly struct AtmosDebugOverlayData
|
|
|
|
|
|
{
|
|
|
|
|
|
public readonly float Temperature;
|
|
|
|
|
|
public readonly float[] Moles;
|
|
|
|
|
|
public readonly AtmosDirection PressureDirection;
|
|
|
|
|
|
public readonly bool InExcitedGroup;
|
2020-11-28 13:45:52 +00:00
|
|
|
|
public readonly AtmosDirection BlockDirection;
|
2020-09-21 00:13:17 +01:00
|
|
|
|
|
2020-11-28 13:45:52 +00:00
|
|
|
|
public AtmosDebugOverlayData(float temperature, float[] moles, AtmosDirection pressureDirection, bool inExcited, AtmosDirection blockDirection)
|
2020-09-21 00:13:17 +01:00
|
|
|
|
{
|
|
|
|
|
|
Temperature = temperature;
|
|
|
|
|
|
Moles = moles;
|
|
|
|
|
|
PressureDirection = pressureDirection;
|
|
|
|
|
|
InExcitedGroup = inExcited;
|
2020-11-28 13:45:52 +00:00
|
|
|
|
BlockDirection = blockDirection;
|
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
|
|
|
|
{
|
|
|
|
|
|
public GridId GridId { get; }
|
|
|
|
|
|
|
2020-10-11 15:21:21 +02:00
|
|
|
|
public Vector2i BaseIdx { get; }
|
2020-09-21 00:13:17 +01:00
|
|
|
|
// LocalViewRange*LocalViewRange
|
|
|
|
|
|
public AtmosDebugOverlayData[] OverlayData { get; }
|
|
|
|
|
|
|
2020-10-11 15:21:21 +02:00
|
|
|
|
public AtmosDebugOverlayMessage(GridId 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
|
|
|
|
}
|
|
|
|
|
|
}
|