using System;
using Content.Shared.Hands.Components;
using Content.Shared.Inventory;
using JetBrains.Annotations;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
namespace Content.Shared.Hands
{
///
/// 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
{
[Obsolete("Use UnequippedHandMessage instead")]
void UnequippedHand(UnequippedHandEventArgs eventArgs);
}
public class UnequippedHandEventArgs : UserEventArgs
{
public UnequippedHandEventArgs(IEntity user, HandState hand) : base(user)
{
Hand = hand;
}
public HandState Hand { get; }
}
///
/// Raised when removing an entity from an inventory slot.
///
[PublicAPI]
public class UnequippedHandEvent : HandledEntityEventArgs
{
///
/// Entity that equipped the item.
///
public IEntity User { get; }
///
/// Item that was unequipped.
///
public IEntity Unequipped { get; }
///
/// Hand that the item is removed from.
///
public HandState Hand { get; }
public UnequippedHandEvent(IEntity user, IEntity unequipped, HandState hand)
{
User = user;
Unequipped = unequipped;
Hand = hand;
}
}
}