using Robust.Shared.Prototypes;
using Robust.Shared.GameStates;
using Content.Shared.DoAfter;
using Robust.Shared.Serialization;
namespace Content.Shared.Tools.Components;
///
/// Logic for using tools (or verbs) to open / close something on an entity.
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ToolOpenableComponent : Component
{
///
/// Is the openable part open or closed?
///
[DataField, AutoNetworkedField]
public bool IsOpen;
///
/// If a tool is needed to open the entity, the time needed to open the entity in seconds.
///
[DataField]
public float OpenTime = 1f;
///
/// If a tool is needed to close the entity, the time needed to close the entity in seconds.
///
[DataField]
public float CloseTime = 1f;
///
/// The quality of the tool needed to open this.
/// If null, it will only be openable by a verb.
///
[DataField]
public ProtoId? OpenToolQualityNeeded;
///
/// The quality of the tool needed to close this.
/// If null, it will only be closable by a verb.
///
[DataField]
public ProtoId? CloseToolQualityNeeded;
///
/// If true, verbs will appear to help interact with opening / closing.
///
[DataField, AutoNetworkedField]
public bool HasVerbs = true;
///
/// If true, the only way to interact is with verbs. Clicking on the entity will not do anything.
///
[DataField, AutoNetworkedField]
public bool VerbOnly;
///
/// The name of what is being opened/closed.
/// e.g toilet lid, panel, compartment.
///
[DataField, AutoNetworkedField]
public LocId? Name;
}
///
/// Simple do after event for opening or closing.
///
[Serializable, NetSerializable]
public sealed partial class ToolOpenableDoAfterEventToggleOpen : SimpleDoAfterEvent;
///
/// AppearanceData keys for use with .
///
[Serializable, NetSerializable]
public enum ToolOpenableVisuals : byte
{
/// : whether the tool-openable stash is open or closed.
ToolOpenableVisualState,
}
///
/// The state of a given tool openable entity.
///
[Serializable, NetSerializable]
public enum ToolOpenableVisualState : byte
{
Open,
Closed
}