#nullable enable
using Content.Shared.GameObjects.Components.Items;
using JetBrains.Annotations;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
namespace Content.Shared.Interfaces.GameObjects.Components
{
///
/// This interface gives components behavior when their entity is removed from a hand slot,
/// even if it is going into another hand slot (which would also fire ).
/// This includes moving the entity from a hand slot into a non-hand slot (which would also fire ).
///
[RequiresExplicitImplementation]
public interface IUnequippedHand
{
void UnequippedHand(UnequippedHandEventArgs eventArgs);
}
public class UnequippedHandEventArgs : UserEventArgs
{
public UnequippedHandEventArgs(IEntity user, SharedHand hand) : base(user)
{
Hand = hand;
}
public SharedHand Hand { get; }
}
///
/// Raised when removing the entity from an inventory slot.
///
[PublicAPI]
public class UnequippedHandMessage : EntitySystemMessage
{
///
/// If this message has already been "handled" by a previous system.
///
public bool Handled { get; set; }
///
/// Entity that equipped the item.
///
public IEntity User { get; }
///
/// Item that was unequipped.
///
public IEntity Unequipped { get; }
///
/// Hand the item is removed from.
///
public SharedHand Hand { get; }
public UnequippedHandMessage(IEntity user, IEntity unequipped, SharedHand hand)
{
User = user;
Unequipped = unequipped;
Hand = hand;
}
}
}