Adds T-ray Scanners (#5420)

This commit is contained in:
Flipp Syder
2021-12-13 23:46:47 -08:00
committed by GitHub
parent 26161e35cb
commit c0bfe43a05
14 changed files with 520 additions and 35 deletions

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Shared.SubFloor;
[RegisterComponent]
[NetworkedComponent]
public class TrayScannerComponent : Component
{
public override string Name { get; } = "TrayScanner";
[ViewVariables]
public bool Toggled { get; set; }
// this should always be rounded
[ViewVariables]
public Vector2 LastLocation { get; set; }
// range of the scanner itself
[DataField("range")]
public float Range { get; set; } = 0.5f;
// exclude entities that are not the set
// of entities in range & entities already revealed
[ViewVariables]
public HashSet<EntityUid> RevealedSubfloors = new();
}
[Serializable, NetSerializable]
public sealed class TrayScannerState : ComponentState
{
public bool Toggled { get; }
public TrayScannerState(bool toggle)
{
Toggled = toggle;
}
}