Atmos optimizations (#1944)
* Adds IFireAct, ITemperatureExpose * Use AtmosDirection instead of Direction for Atmos * Refactor atmos to heavily rely on arrays and bitflags. Adds F A S T M O S and reduces atmos tech debt heavily. * Optimize and fix more stuff * Kinda improve superconduction * Pipenet is a word * T U R B O M O S * Address reviews * Small optimization * Superconduct is also a word * Remove check * Cleanup tile atmosphere * Correct a comment
This commit is contained in:
committed by
GitHub
parent
3758eb1b60
commit
fb0ac3d70e
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Content.Shared.Atmos;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -30,15 +31,15 @@ namespace Content.Server.Atmos
|
||||
[ViewVariables]
|
||||
public float TransferDirectionSouth;
|
||||
|
||||
public float this[Direction direction]
|
||||
public float this[AtmosDirection direction]
|
||||
{
|
||||
get =>
|
||||
direction switch
|
||||
{
|
||||
Direction.East => TransferDirectionEast,
|
||||
Direction.West => TransferDirectionWest,
|
||||
Direction.North => TransferDirectionNorth,
|
||||
Direction.South => TransferDirectionSouth,
|
||||
AtmosDirection.East => TransferDirectionEast,
|
||||
AtmosDirection.West => TransferDirectionWest,
|
||||
AtmosDirection.North => TransferDirectionNorth,
|
||||
AtmosDirection.South => TransferDirectionSouth,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(direction))
|
||||
};
|
||||
|
||||
@@ -46,16 +47,16 @@ namespace Content.Server.Atmos
|
||||
{
|
||||
switch (direction)
|
||||
{
|
||||
case Direction.East:
|
||||
case AtmosDirection.East:
|
||||
TransferDirectionEast = value;
|
||||
break;
|
||||
case Direction.West:
|
||||
case AtmosDirection.West:
|
||||
TransferDirectionWest = value;
|
||||
break;
|
||||
case Direction.North:
|
||||
case AtmosDirection.North:
|
||||
TransferDirectionNorth = value;
|
||||
break;
|
||||
case Direction.South:
|
||||
case AtmosDirection.South:
|
||||
TransferDirectionSouth = value;
|
||||
break;
|
||||
default:
|
||||
@@ -64,10 +65,16 @@ namespace Content.Server.Atmos
|
||||
}
|
||||
}
|
||||
|
||||
public float this[int index]
|
||||
{
|
||||
get => this[(AtmosDirection) (1 << index)];
|
||||
set => this[(AtmosDirection) (1 << index)] = value;
|
||||
}
|
||||
|
||||
[ViewVariables]
|
||||
public float CurrentTransferAmount;
|
||||
|
||||
public Direction CurrentTransferDirection;
|
||||
public AtmosDirection CurrentTransferDirection;
|
||||
|
||||
[ViewVariables]
|
||||
public bool FastDone;
|
||||
|
||||
Reference in New Issue
Block a user