2022-11-18 22:08:28 +01:00
|
|
|
using Content.Server.Buckle.Systems;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Buckle.Components;
|
2020-06-25 15:52:24 +02:00
|
|
|
|
2022-11-14 20:30:30 +01:00
|
|
|
namespace Content.Server.Buckle.Components;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Component that handles sitting entities into <see cref="StrapComponent"/>s.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
[ComponentReference(typeof(SharedBuckleComponent))]
|
2022-11-18 22:08:28 +01:00
|
|
|
[Access(typeof(BuckleSystem))]
|
2022-11-14 20:30:30 +01:00
|
|
|
public sealed class BuckleComponent : SharedBuckleComponent
|
2020-06-25 15:52:24 +02:00
|
|
|
{
|
2021-02-20 01:20:52 +01:00
|
|
|
/// <summary>
|
2022-11-14 20:30:30 +01:00
|
|
|
/// The amount of time that must pass for this entity to
|
|
|
|
|
/// be able to unbuckle after recently buckling.
|
2021-02-20 01:20:52 +01:00
|
|
|
/// </summary>
|
2022-11-14 20:30:30 +01:00
|
|
|
[DataField("delay")]
|
|
|
|
|
public TimeSpan UnbuckleDelay = TimeSpan.FromSeconds(0.25f);
|
2020-07-24 14:22:28 +02:00
|
|
|
|
2022-11-14 20:30:30 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// The time that this entity buckled at.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables] public TimeSpan BuckleTime;
|
2021-06-01 23:42:54 +10:00
|
|
|
|
2022-11-14 20:30:30 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// The strap that this component is buckled to.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
public StrapComponent? BuckledTo { get; set; }
|
2020-06-25 15:52:24 +02:00
|
|
|
|
2022-11-14 20:30:30 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// The amount of space that this entity occupies in a
|
|
|
|
|
/// <see cref="StrapComponent"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("size")]
|
|
|
|
|
public int Size = 100;
|
2020-06-25 15:52:24 +02:00
|
|
|
}
|