Refactor Barotrauma to be ECS. (#4674)

- Refactor IPressureProtection to be two different ECS events.
This commit is contained in:
Vera Aguilera Puerto
2021-09-22 13:02:25 +02:00
committed by GitHub
parent 6891c32eb5
commit 246fda53c5
8 changed files with 217 additions and 144 deletions

View File

@@ -17,11 +17,9 @@ namespace Content.Server.Atmos.Components
[ViewVariables]
[ComponentDependency] private readonly TemperatureComponent? _temperatureComponent = null;
[ViewVariables]
[ComponentDependency] private readonly BarotraumaComponent? _barotraumaComponent = null;
public void Update(GasMixture air, float frameDelta, AtmosphereSystem atmosphereSystem)
{
// TODO: I'm coming for you next, TemperatureComponent... Fear me for I am death, destroyer of shitcode.
if (_temperatureComponent != null)
{
var temperatureDelta = air.Temperature - _temperatureComponent.CurrentTemperature;
@@ -30,8 +28,6 @@ namespace Content.Server.Atmos.Components
_temperatureComponent.ReceiveHeat(heat);
_temperatureComponent.Update();
}
_barotraumaComponent?.Update(air.Pressure);
}
}
}