Files
tbd-station-14/Content.Shared/Interfaces/GameObjects/Components/Interaction/IHandSelected.cs
ShadowCommander acb102f978 Rename and clean up interaction events (#4044)
* Rename and clean up interaction events

* Fix hand equip events
2021-05-22 21:06:40 -07:00

52 lines
1.3 KiB
C#

#nullable enable
using System;
using JetBrains.Annotations;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
namespace Content.Shared.Interfaces.GameObjects.Components
{
/// <summary>
/// This interface gives components behavior when they're held on the selected hand.
/// </summary>
[RequiresExplicitImplementation]
public interface IHandSelected
{
[Obsolete("Use HandSelectedMessage instead")]
void HandSelected(HandSelectedEventArgs eventArgs);
}
public class HandSelectedEventArgs : EventArgs
{
public HandSelectedEventArgs(IEntity user)
{
User = user;
}
public IEntity User { get; }
}
/// <summary>
/// Raised when an item entity held by a hand is selected.
/// </summary>
[PublicAPI]
public class HandSelectedEvent : HandledEntityEventArgs
{
/// <summary>
/// Entity that owns the selected hand.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Item in the hand that was selected.
/// </summary>
public IEntity Item { get; }
public HandSelectedEvent(IEntity user, IEntity item)
{
User = user;
Item = item;
}
}
}