ECS Atmos Part 5: Moves all logic from GridAtmosphereComponent to AtmosphereSystem. (#4331)

This commit is contained in:
Vera Aguilera Puerto
2021-07-23 11:09:01 +02:00
committed by GitHub
parent 354ef6daf3
commit 4112847142
23 changed files with 1242 additions and 1355 deletions

View File

@@ -48,21 +48,24 @@ namespace Content.Server.Atmos.EntitySystems
public bool ConsiderSuperconductivity(GridAtmosphereComponent gridAtmosphere, TileAtmosphere tile)
{
if (tile.ThermalConductivity == 0f)
if (tile.ThermalConductivity == 0f || !Superconduction)
return false;
gridAtmosphere.AddSuperconductivityTile(tile);
gridAtmosphere.SuperconductivityTiles.Add(tile);
return true;
}
public bool ConsiderSuperconductivity(GridAtmosphereComponent gridAtmosphere, TileAtmosphere tile, bool starting)
{
if (!Superconduction)
return false;
if (tile.Air == null || tile.Air.Temperature < (starting
? Atmospherics.MinimumTemperatureStartSuperConduction
: Atmospherics.MinimumTemperatureForSuperconduction))
return false;
return !(gridAtmosphere.AtmosphereSystem.GetHeatCapacity(tile.Air) < Atmospherics.MCellWithRatio)
return !(GetHeatCapacity(tile.Air) < Atmospherics.MCellWithRatio)
&& ConsiderSuperconductivity(gridAtmosphere, tile);
}
@@ -82,7 +85,7 @@ namespace Content.Server.Atmos.EntitySystems
// Make sure it's still hot enough to continue conducting.
if (temperature < Atmospherics.MinimumTemperatureForSuperconduction)
{
gridAtmosphere.RemoveSuperconductivityTile(tile);
gridAtmosphere.SuperconductivityTiles.Remove(tile);
}
}
@@ -112,7 +115,7 @@ namespace Content.Server.Atmos.EntitySystems
TemperatureShareOpenToSolid(tile, other);
}
gridAtmosphere.AddActiveTile(tile);
AddActiveTile(gridAtmosphere, tile);
}
private void TemperatureShareOpenToSolid(TileAtmosphere tile, TileAtmosphere other)