using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Serialization;
namespace Content.Shared.Pulling.Components
{
// Before you try to add another type than SharedPullingStateManagementSystem, consider the can of worms you may be opening!
[NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedPullingStateManagementSystem))]
[RegisterComponent]
public sealed partial class SharedPullableComponent : Component
{
///
/// The current entity pulling this component.
///
[DataField, AutoNetworkedField]
public EntityUid? Puller { get; set; }
///
/// The pull joint.
///
[DataField, AutoNetworkedField]
public string? PullJointId { get; set; }
public bool BeingPulled => Puller != null;
[Access(typeof(SharedPullingStateManagementSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
public EntityCoordinates? MovingTo { get; set; }
///
/// If the physics component has FixedRotation should we keep it upon being pulled
///
[Access(typeof(SharedPullingSystem), Other = AccessPermissions.ReadExecute)]
[ViewVariables(VVAccess.ReadWrite), DataField("fixedRotation")]
public bool FixedRotationOnPull { get; set; }
///
/// What the pullable's fixedrotation was set to before being pulled.
///
[Access(typeof(SharedPullingSystem), Other = AccessPermissions.ReadExecute)]
[ViewVariables]
public bool PrevFixedRotation;
}
///
/// Raised when a request is made to stop pulling an entity.
///
public sealed class StopPullingEvent : CancellableEntityEventArgs
{
public EntityUid? User { get; }
public StopPullingEvent(EntityUid? uid = null)
{
User = uid;
}
}
}