Kills TurfHelpers (#37939)

* Create TurfSystem equivalent for and obsolete TurfHelpers.GetTileRef

* Fix EntitySystem uses of TurfHelpers.GetTileRef

* Fix EntitySystem uses of TurfHelpers.TryGetTileRef

* Fix construction condition uses of TurfHelpers.GetTileRef

* Fix last use of TurfHelpers.IsBlockedTurf

* Create TurfSystem equivalent to and obsolete TurfHelpers.GetContentTileDefinition

* Fix uses of TurfHelpers.GetContentTileDefinition(TileRef)

* Fix uses of TurfHelpers.GetContentTileDefinition(Tile)

* Create TurfSystem equivalent to and obsolete TurfHelpers.IsSpace

* Fix EntitySystem uses of TurfHelpers.IsSpace(Tile)

* Fix EntitySystem uses of TurfHelpers.IsSpace(TileRef)

* Fix remaining uses of TurfHelpers.IsSpace

* Fix uses of TurfHelpers.GetEntitiesInTile

* Delete TurfHelpers.cs

* Add GetEntitiesInTile lookup methods

* Convert some GetEntitiesInTile methods to LookupSystem extension methods

* Use new GetEntitiesInTile methods

* Recycle spiderweb hashset

* Recycle floor tile hashset
This commit is contained in:
TemporalOroboros
2025-06-21 08:23:19 -07:00
committed by GitHub
parent 334dc61d4d
commit d4876be6f0
37 changed files with 251 additions and 229 deletions

View File

@@ -26,13 +26,13 @@ namespace Content.Server.Shuttles.Systems;
public sealed class ThrusterSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
[Dependency] private readonly AmbientSoundSystem _ambient = default!;
[Dependency] private readonly FixtureSystem _fixtureSystem = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly SharedPointLightSystem _light = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly TurfSystem _turf = default!;
// Essentially whenever thruster enables we update the shuttle's available impulses which are used for movement.
// This is done for each direction available.
@@ -97,7 +97,7 @@ public sealed class ThrusterSystem : EntitySystem
foreach (var change in args.Changes)
{
// If the old tile was space but the new one isn't then disable all adjacent thrusters
if (change.NewTile.IsSpace(_tileDefManager) || !change.OldTile.IsSpace(_tileDefManager))
if (_turf.IsSpace(change.NewTile) || !_turf.IsSpace(change.OldTile))
continue;
var tilePos = change.GridIndices;
@@ -457,7 +457,7 @@ public sealed class ThrusterSystem : EntitySystem
var mapGrid = Comp<MapGridComponent>(xform.GridUid.Value);
var tile = _mapSystem.GetTileRef(xform.GridUid.Value, mapGrid, new Vector2i((int)Math.Floor(x), (int)Math.Floor(y)));
return tile.Tile.IsSpace();
return _turf.IsSpace(tile);
}
#region Burning