2020-06-25 15:52:24 +02:00
|
|
|
|
using System;
|
2020-07-02 23:36:06 +02:00
|
|
|
|
using Content.Shared.GameObjects.EntitySystems;
|
2020-06-25 15:52:24 +02:00
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
|
2020-07-17 10:43:10 +02:00
|
|
|
|
namespace Content.Shared.GameObjects.Components.Buckle
|
2020-06-25 15:52:24 +02:00
|
|
|
|
{
|
2020-07-02 23:36:06 +02:00
|
|
|
|
public abstract class SharedBuckleComponent : Component, IActionBlocker, IEffectBlocker
|
2020-06-25 15:52:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
public sealed override string Name => "Buckle";
|
|
|
|
|
|
|
2020-07-02 23:36:06 +02:00
|
|
|
|
public sealed override uint? NetID => ContentNetIDs.BUCKLE;
|
|
|
|
|
|
|
2020-07-17 10:43:10 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// True if the entity is buckled, false otherwise.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public abstract bool Buckled { get; }
|
2020-07-02 23:36:06 +02:00
|
|
|
|
|
|
|
|
|
|
bool IActionBlocker.CanMove()
|
|
|
|
|
|
{
|
|
|
|
|
|
return !Buckled;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool IActionBlocker.CanChangeDirection()
|
|
|
|
|
|
{
|
|
|
|
|
|
return !Buckled;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool IEffectBlocker.CanFall()
|
|
|
|
|
|
{
|
|
|
|
|
|
return !Buckled;
|
|
|
|
|
|
}
|
2020-07-17 10:43:10 +02:00
|
|
|
|
}
|
2020-07-02 23:36:06 +02:00
|
|
|
|
|
2020-07-17 10:43:10 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public sealed class BuckleComponentState : ComponentState
|
|
|
|
|
|
{
|
|
|
|
|
|
public BuckleComponentState(bool buckled, int? drawDepth) : base(ContentNetIDs.BUCKLE)
|
2020-07-02 23:36:06 +02:00
|
|
|
|
{
|
2020-07-17 10:43:10 +02:00
|
|
|
|
Buckled = buckled;
|
|
|
|
|
|
DrawDepth = drawDepth;
|
2020-07-02 23:36:06 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-07-17 10:43:10 +02:00
|
|
|
|
public bool Buckled { get; }
|
|
|
|
|
|
public int? DrawDepth;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public enum BuckleVisuals
|
|
|
|
|
|
{
|
|
|
|
|
|
Buckled
|
2020-06-25 15:52:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|