mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-04 05:17:28 +00:00
* update code to allow long range crew monitor to work * add syndicate crew monitor prototype * update listening post to cull bloat and use new crew monitor --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
26 lines
798 B
C#
26 lines
798 B
C#
using Content.Shared.Station.Components;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Map.Components;
|
|
|
|
namespace Content.Shared._DV.Medical.CrewMonitoring;
|
|
|
|
public sealed class LongRangeCrewMonitorSystem : EntitySystem
|
|
{
|
|
/// <summary>
|
|
/// Finds an arbitrary station grid on the same map as the argument.
|
|
/// Returns null if no grid was found.
|
|
/// </summary>
|
|
public EntityUid? FindStationGridInMap(MapId map)
|
|
{
|
|
// also requiring MapGrid incase StationMember gets used for non-grids in the future
|
|
var query = EntityQueryEnumerator<StationMemberComponent, MapGridComponent>();
|
|
while (query.MoveNext(out var grid, out _, out _))
|
|
{
|
|
if (Transform(grid).MapID == map)
|
|
return grid;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|