2021-11-20 18:26:01 +13:00
|
|
|
using Content.Shared.Containers.ItemSlots;
|
2021-07-10 17:35:33 +02:00
|
|
|
using Content.Shared.Sound;
|
2021-06-08 19:10:29 -07:00
|
|
|
|
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]
|
2022-02-09 18:53:44 -07:00
|
|
|
public sealed class ItemCabinetComponent : Component
|
2021-06-08 19:10:29 -07:00
|
|
|
{
|
|
|
|
|
/// <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-11-20 18:26:01 +13:00
|
|
|
/// The <see cref="ItemSlot"/> that stores the actual item. The entity whitelist, sounds, and other
|
|
|
|
|
/// behaviours are specified by this <see cref="ItemSlot"/> definition.
|
2021-06-08 19:10:29 -07:00
|
|
|
/// </summary>
|
2021-10-06 08:55:45 +11:00
|
|
|
[DataField("cabinetSlot")]
|
2021-11-20 18:26:01 +13:00
|
|
|
public ItemSlot CabinetSlot = new();
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|