Files
crystall-punk-14/Content.Shared/SubFloor/TrayScannerComponent.cs

45 lines
1.1 KiB
C#
Raw Normal View History

2021-12-13 23:46:47 -08:00
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.SubFloor;
[RegisterComponent]
[NetworkedComponent]
public sealed class TrayScannerComponent : Component
2021-12-13 23:46:47 -08:00
{
/// <summary>
/// Whether the scanner is currently on.
/// </summary>
2021-12-13 23:46:47 -08:00
[ViewVariables]
public bool Enabled { get; set; }
2021-12-13 23:46:47 -08:00
/// <summary>
/// Last position of the scanner. Rounded to integers to avoid excessive entity lookups when moving.
/// </summary>
2021-12-13 23:46:47 -08:00
[ViewVariables]
public Vector2i? LastLocation { get; set; }
2021-12-13 23:46:47 -08:00
/// <summary>
/// Radius in which the scanner will reveal entities. Centered on the <see cref="LastLocation"/>.
/// </summary>
2021-12-13 23:46:47 -08:00
[DataField("range")]
public float Range { get; set; } = 2.5f;
2021-12-13 23:46:47 -08:00
/// <summary>
/// The sub-floor entities that this scanner is currently revealing.
/// </summary>
2021-12-13 23:46:47 -08:00
[ViewVariables]
public HashSet<EntityUid> RevealedSubfloors = new();
}
[Serializable, NetSerializable]
public sealed class TrayScannerState : ComponentState
{
public bool Enabled;
2021-12-13 23:46:47 -08:00
public TrayScannerState(bool enabled)
2021-12-13 23:46:47 -08:00
{
Enabled = enabled;
2021-12-13 23:46:47 -08:00
}
}