Layering for atmospheric pipes (#36124)

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
Co-authored-by: Kevin Zheng <kevinz5000@gmail.com>
This commit is contained in:
chromiumboy
2025-06-02 00:01:43 -05:00
committed by GitHub
parent aa5ca90a3b
commit 45012cbe1d
134 changed files with 2671 additions and 306 deletions

View File

@@ -64,10 +64,10 @@ public struct AtmosPipeChunk(Vector2i origin)
/// <summary>
/// Bitmask look up for atmos pipes, 1 for occupied and 0 for empty.
/// Indexed by the color hexcode of the pipe
/// Indexed by the net ID, layer and color hexcode of the pipe
/// </summary>
[ViewVariables]
public Dictionary<(int, string), ulong> AtmosPipeData = new();
public Dictionary<AtmosMonitoringConsoleSubnet, ulong> AtmosPipeData = new();
/// <summary>
/// The last game tick that the chunk was updated
@@ -90,7 +90,7 @@ public struct AtmosDeviceNavMapData
public NetCoordinates NetCoordinates;
/// <summary>
/// The associated pipe network ID
/// The associated pipe network ID
/// </summary>
public int NetId = -1;
@@ -109,10 +109,21 @@ public struct AtmosDeviceNavMapData
/// </summary>
public Color PipeColor;
/// <summary>
/// The pipe layer the entity is on
/// </summary>
public AtmosPipeLayer PipeLayer;
/// <summary>
/// Populate the atmos monitoring console nav map with a single entity
/// </summary>
public AtmosDeviceNavMapData(NetEntity netEntity, NetCoordinates netCoordinates, int netId, ProtoId<NavMapBlipPrototype> navMapBlip, Direction direction, Color pipeColor)
public AtmosDeviceNavMapData(NetEntity netEntity,
NetCoordinates netCoordinates,
int netId,
ProtoId<NavMapBlipPrototype> navMapBlip,
Direction direction,
Color pipeColor,
AtmosPipeLayer pipeLayer)
{
NetEntity = netEntity;
NetCoordinates = netCoordinates;
@@ -120,6 +131,7 @@ public struct AtmosDeviceNavMapData
NavMapBlip = navMapBlip;
Direction = direction;
PipeColor = pipeColor;
PipeLayer = pipeLayer;
}
}
@@ -154,7 +166,7 @@ public struct AtmosMonitoringConsoleEntry
public NetCoordinates Coordinates;
/// <summary>
/// The associated pipe network ID
/// The associated pipe network ID
/// </summary>
public int NetId = -1;
@@ -184,7 +196,7 @@ public struct AtmosMonitoringConsoleEntry
public float TotalMolData;
/// <summary>
/// Mol and percentage for all detected gases
/// Mol and percentage for all detected gases
/// </summary>
public Dictionary<Gas, float> GasData = new();
@@ -216,6 +228,16 @@ public struct AtmosMonitoringConsoleEntry
}
}
/// <summary>
/// Used to group atmos pipe chunks into subnets based on their properties and
/// improve the efficiency of rendering these chunks on the atmos monitoring console.
/// </summary>
/// <param name="NetId">The associated network ID.</param>
/// <param name="PipeLayer">The associated pipe layer.</param>
/// <param name="HexCode">The color of the pipe.</param>
[Serializable, NetSerializable]
public record AtmosMonitoringConsoleSubnet(int NetId, AtmosPipeLayer PipeLayer, string HexCode);
public enum AtmosPipeChunkDataFacing : byte
{
// Values represent bit shift offsets when retrieving data in the tile array.