Files
tbd-station-14/Content.Server/NodeContainer/Nodes/AdjacentNode.cs
metalgearsloth bd69fc612a Predicted internals (#33800)
* Predicted gas pumps

I wanted to try out atmos and first thing I found.

* a

* Atmos device prediction

- Canisters
- Tanks
- Internals

AirMixes aren't predicted so nothing on that front but all the UIs should be a lot closer.

* Remove details range

* Gas tank prediction

* Even more sweeping changes

* Alerts

* rehg

* Popup fix

* Fix merge conflicts

* Fix

* Review
2025-05-02 18:22:29 +10:00

32 lines
1.0 KiB
C#

using Content.Shared.NodeContainer;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
namespace Content.Server.NodeContainer.Nodes
{
/// <summary>
/// A <see cref="Node"/> that can reach other <see cref="AdjacentNode"/>s that are directly adjacent to it.
/// </summary>
[DataDefinition]
public sealed partial class AdjacentNode : Node
{
public override IEnumerable<Node> GetReachableNodes(TransformComponent xform,
EntityQuery<NodeContainerComponent> nodeQuery,
EntityQuery<TransformComponent> xformQuery,
MapGridComponent? grid,
IEntityManager entMan)
{
if (!xform.Anchored || grid == null)
yield break;
var gridIndex = grid.TileIndicesFor(xform.Coordinates);
foreach (var (_, node) in NodeHelpers.GetCardinalNeighborNodes(nodeQuery, grid, gridIndex))
{
if (node != this)
yield return node;
}
}
}
}