Files
tbd-station-14/Content.Server/Wires/WiresComponent.cs
Paul Ritter f77aff7b94 prototype composition (#9979) & updates submodule
* prototype composition

* a

* fixes build

* fixes test

* updates submodule

Co-authored-by: Paul Ritter <ritter.paul1@gmail.com>
2022-08-01 14:39:37 +02:00

92 lines
3.0 KiB
C#

using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Wires;
[RegisterComponent]
public sealed class WiresComponent : Component
{
/// <summary>
/// Is the panel open for this entity's wires?
/// </summary>
[ViewVariables]
public bool IsPanelOpen { get; set; }
/// <summary>
/// Should this entity's wires panel be visible at all?
/// </summary>
[ViewVariables]
public bool IsPanelVisible { get; set; } = true;
/// <summary>
/// The name of this entity's internal board.
/// </summary>
[ViewVariables]
[DataField("BoardName")]
public string BoardName { get; set; } = "Wires";
/// <summary>
/// The layout ID of this entity's wires.
/// </summary>
[ViewVariables]
[DataField("LayoutId", customTypeSerializer: typeof(PrototypeIdSerializer<WireLayoutPrototype>), required: true)]
public string LayoutId { get; set; } = default!;
/// <summary>
/// The serial number of this board. Randomly generated upon start,
/// does not need to be set.
/// </summary>
[ViewVariables]
public string? SerialNumber { get; set; }
/// <summary>
/// The seed that dictates the wires appearance, as well as
/// the status ordering on the UI client side.
/// </summary>
[ViewVariables]
public int WireSeed { get; set; }
/// <summary>
/// The list of wires currently active on this entity.
/// </summary>
[ViewVariables]
public List<Wire> WiresList { get; set; } = new();
/// <summary>
/// Queue of wires saved while the wire's DoAfter event occurs, to prevent too much spam.
/// </summary>
[ViewVariables]
public List<int> WiresQueue { get; } = new();
/// <summary>
/// If this should follow the layout saved the first time the layout dictated by the
/// layout ID is generated, or if a new wire order should be generated every time.
/// </summary>
[ViewVariables]
[DataField("alwaysRandomize")]
public bool AlwaysRandomize { get; }
/// <summary>
/// Per wire status, keyed by an object.
/// </summary>
[ViewVariables]
public Dictionary<object, object> Statuses { get; } = new();
/// <summary>
/// The state data for the set of wires inside of this entity.
/// This is so that wire objects can be flyweighted between
/// entities without any issues.
/// </summary>
[ViewVariables]
public Dictionary<object, object> StateData { get; } = new();
[DataField("pulseSound")]
public SoundSpecifier PulseSound = new SoundPathSpecifier("/Audio/Effects/multitool_pulse.ogg");
[DataField("screwdriverOpenSound")]
public SoundSpecifier ScrewdriverOpenSound = new SoundPathSpecifier("/Audio/Machines/screwdriveropen.ogg");
[DataField("screwdriverCloseSound")]
public SoundSpecifier ScrewdriverCloseSound = new SoundPathSpecifier("/Audio/Machines/screwdriverclose.ogg");
}