using Content.Shared.FixedPoint; using Content.Shared.ProximityDetection.Systems; using Content.Shared.Whitelist; using Robust.Shared.GameStates; namespace Content.Shared.ProximityDetection.Components; /// /// This is used to search for the closest entity with a range that matches specified requirements (tags and/or components) /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState ,Access(typeof(ProximityDetectionSystem))] public sealed partial class ProximityDetectorComponent : Component { /// /// The criteria used to filter entities /// Note: RequireAll is only supported for tags, all components are required to count as a match! /// [DataField( required: true), AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)] public EntityWhitelist Criteria = new(); /// /// Found Entity /// [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public EntityUid? TargetEnt; /// /// Distance to Found Entity /// [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public FixedPoint2 Distance = -1; /// /// The farthest distance to search for targets /// [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public FixedPoint2 Range = 10f; // TODO: use timespans not this public float AccumulatedFrameTime; [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public float UpdateRate = 0.3f; }