2021-07-10 17:35:33 +02:00
|
|
|
using Content.Shared.Sound;
|
2021-06-08 19:10:29 -07:00
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
|
|
|
|
using Robust.Shared.ViewVariables;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Cabinet
|
2021-06-08 19:10:29 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2021-10-06 08:55:45 +11:00
|
|
|
/// Used for entities that can be opened, closed, and can hold one item. E.g., fire extinguisher cabinets.
|
2021-06-08 19:10:29 -07:00
|
|
|
/// </summary>
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
public class ItemCabinetComponent : Component
|
|
|
|
|
{
|
|
|
|
|
public override string Name => "ItemCabinet";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sound to be played when the cabinet door is opened.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2021-07-31 19:52:33 +02:00
|
|
|
[DataField("doorSound", required: true)]
|
2021-07-10 17:35:33 +02:00
|
|
|
public SoundSpecifier DoorSound { get; set; } = default!;
|
2021-06-08 19:10:29 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
2021-10-06 08:55:45 +11:00
|
|
|
/// The slot name, used to get the actual item slot from the ItemSlotsComponent.
|
2021-06-08 19:10:29 -07:00
|
|
|
/// </summary>
|
2021-10-06 08:55:45 +11:00
|
|
|
[DataField("cabinetSlot")]
|
|
|
|
|
public string CabinetSlot = "cabinetSlot";
|
2021-06-08 19:10:29 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether the cabinet is currently open or not.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
[DataField("opened")]
|
|
|
|
|
public bool Opened { get; set; } = false;
|
|
|
|
|
}
|
|
|
|
|
}
|