Files
tbd-station-14/Content.Shared/RCD/Components/RCDComponent.cs
gus 2c60d6b27f RCD Refactor (#34781)
* fixed prediction (hopefully), removed caching of prototype, sealed the class, removed any and count

* erroneus using statement

* removed unused timing, removed obsolete method of getting gridUid

* nuked mapgriddata

* code cleanup

* cleanup

* this has to be a string without me rewriting more code than i want to in this moment

* kill

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2025-04-17 21:34:38 -04:00

61 lines
1.9 KiB
C#

using Content.Shared.RCD.Systems;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Physics;
using Robust.Shared.Prototypes;
namespace Content.Shared.RCD.Components;
/// <summary>
/// Main component for the RCD
/// Optionally uses LimitedChargesComponent.
/// Charges can be refilled with RCD ammo
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(RCDSystem))]
public sealed partial class RCDComponent : Component
{
/// <summary>
/// List of RCD prototypes that the device comes loaded with
/// </summary>
[DataField, AutoNetworkedField]
public HashSet<ProtoId<RCDPrototype>> AvailablePrototypes { get; set; } = new();
/// <summary>
/// Sound that plays when a RCD operation successfully completes
/// </summary>
[DataField]
public SoundSpecifier SuccessSound { get; set; } = new SoundPathSpecifier("/Audio/Items/deconstruct.ogg");
/// <summary>
/// The ProtoId of the currently selected RCD prototype
/// </summary>
[DataField, AutoNetworkedField]
public ProtoId<RCDPrototype> ProtoId { get; set; } = "Invalid";
/// <summary>
/// The direction constructed entities will face upon spawning
/// </summary>
[DataField, AutoNetworkedField]
public Direction ConstructionDirection
{
get => _constructionDirection;
set
{
_constructionDirection = value;
ConstructionTransform = new Transform(new(), _constructionDirection.ToAngle());
}
}
private Direction _constructionDirection = Direction.South;
/// <summary>
/// Returns a rotated transform based on the specified ConstructionDirection
/// </summary>
/// <remarks>
/// Contains no position data
/// </remarks>
[ViewVariables(VVAccess.ReadOnly)]
public Transform ConstructionTransform { get; private set; }
}