2025-05-11 17:33:35 +03:00
|
|
|
|
using Content.Shared.ProximityDetection.Components;
|
2024-01-04 15:56:23 -08:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.ProximityDetection;
|
|
|
|
|
|
|
2025-05-11 17:33:35 +03:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Raised to determine if proximity sensor can detect an entity.
|
|
|
|
|
|
/// </summary>
|
2024-01-04 15:56:23 -08:00
|
|
|
|
[ByRefEvent]
|
2025-05-11 17:33:35 +03:00
|
|
|
|
public struct ProximityDetectionAttemptEvent(float distance, Entity<ProximityDetectorComponent> detector, EntityUid target)
|
|
|
|
|
|
{
|
|
|
|
|
|
public bool Cancelled;
|
|
|
|
|
|
public readonly float Distance = distance;
|
|
|
|
|
|
public readonly Entity<ProximityDetectorComponent> Detector = detector;
|
|
|
|
|
|
public readonly EntityUid Target = target;
|
|
|
|
|
|
}
|
2024-01-04 15:56:23 -08:00
|
|
|
|
|
2025-05-11 17:33:35 +03:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Raised when distance from proximity sensor to the target was updated.
|
|
|
|
|
|
/// </summary>
|
2024-01-04 15:56:23 -08:00
|
|
|
|
[ByRefEvent]
|
2025-05-11 17:33:35 +03:00
|
|
|
|
public readonly record struct ProximityTargetUpdatedEvent(float Distance, Entity<ProximityDetectorComponent> Detector, EntityUid? Target = null);
|
2024-01-04 15:56:23 -08:00
|
|
|
|
|
2025-05-11 17:33:35 +03:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Raised when proximity sensor got new target.
|
|
|
|
|
|
/// </summary>
|
2024-01-04 15:56:23 -08:00
|
|
|
|
[ByRefEvent]
|
2025-05-11 17:33:35 +03:00
|
|
|
|
public readonly record struct NewProximityTargetEvent(float Distance, Entity<ProximityDetectorComponent> Detector, EntityUid? Target = null);
|