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 = false;
///
/// If a tool is needed to open the entity, this time will be used.
///
[DataField]
public float OpenTime = 1f;
///
/// If a tool is needed to close the entity, this time will be used.
///
[DataField]
public float CloseTime = 1f;
///
/// What type of tool quality is needed to open this?
/// If null, the it will only be openable by a verb.
///
[DataField]
public ProtoId? OpenToolQualityNeeded;
///
/// What type of tool quality is needed to close this.
/// If null, this 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 open and closed.
/// E.g toilet lid, pannel, compartment.
///
[DataField, AutoNetworkedField]
public string? Name;
}
///
/// Simple do after event for opening or closing.
///
[Serializable, NetSerializable]
public sealed partial class ToolOpenableDoAfterEventToggleOpen : SimpleDoAfterEvent
{
}
///
/// Visualizers for handling stash open closed state if stash has door.
///
[Serializable, NetSerializable]
public enum ToolOpenableVisuals : byte
{
ToolOpenableVisualState,
}
[Serializable, NetSerializable]
public enum ToolOpenableVisualState : byte
{
Open,
Closed
}
}