Files
tbd-station-14/Content.Shared/Pinpointer/PinpointerComponent.cs
Alex Evgrashin c1cf22d97e Pinpointer (#5131)
* Add pinpointer sprites

* Start working on pinpointer

* Updated pinpointer

* Working on visuals

* Working on a pinpointer and eye rotation

* Add client/server pinpointers systems

* Minor cleanup

* Add distance support

* Add nuke tag

* Remove redundant flag and add pinpointer to caps locker

* Disable rotation of pinpointer

* Fixed distance

Co-authored-by: Alexander Evgrashin <evgrashin.adl@gmail.com>
2021-11-03 14:35:34 -07:00

55 lines
1.4 KiB
C#

using System;
using Content.Shared.Whitelist;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Shared.Pinpointer
{
[RegisterComponent]
[NetworkedComponent]
[Friend(typeof(SharedPinpointerSystem))]
public class PinpointerComponent : Component
{
public override string Name => "Pinpointer";
[DataField("whitelist")]
public EntityWhitelist? Whitelist;
[DataField("mediumDistance")]
public float MediumDistance = 16f;
[DataField("closeDistance")]
public float CloseDistance = 8f;
[DataField("reachedDistance")]
public float ReachedDistance = 1f;
public EntityUid? Target = null;
public bool IsActive = false;
public Direction DirectionToTarget = Direction.Invalid;
public Distance DistanceToTarget = Distance.UNKNOWN;
}
[Serializable, NetSerializable]
public sealed class PinpointerComponentState : ComponentState
{
public bool IsActive;
public Direction DirectionToTarget;
public Distance DistanceToTarget;
}
[Serializable, NetSerializable]
public enum Distance : byte
{
UNKNOWN,
REACHED,
CLOSE,
MEDIUM,
FAR
}
}