2021-03-09 11:22:48 -08:00
|
|
|
#nullable enable
|
2021-02-27 04:12:09 +01:00
|
|
|
using System;
|
2020-07-06 14:27:03 -07:00
|
|
|
using JetBrains.Annotations;
|
2021-01-23 22:45:23 +01:00
|
|
|
using Robust.Shared.Analyzers;
|
2020-07-06 14:27:03 -07:00
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
2020-07-18 22:51:56 -07:00
|
|
|
namespace Content.Shared.Interfaces.GameObjects.Components
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This interface gives components behavior when they're held on a deselected hand.
|
|
|
|
|
/// </summary>
|
2021-01-23 20:00:29 +01:00
|
|
|
[RequiresExplicitImplementation]
|
2020-07-06 14:27:03 -07:00
|
|
|
public interface IHandDeselected
|
|
|
|
|
{
|
2021-04-29 03:23:15 +10:00
|
|
|
[Obsolete("Use HandDeselectedMessage instead")]
|
2020-07-06 14:27:03 -07:00
|
|
|
void HandDeselected(HandDeselectedEventArgs eventArgs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class HandDeselectedEventArgs : EventArgs
|
|
|
|
|
{
|
|
|
|
|
public HandDeselectedEventArgs(IEntity user)
|
|
|
|
|
{
|
|
|
|
|
User = user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEntity User { get; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Raised when an entity item in a hand is deselected.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[PublicAPI]
|
2021-05-22 21:06:40 -07:00
|
|
|
public class HandDeselectedEvent : HandledEntityEventArgs
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity that owns the deselected hand.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEntity User { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-05-22 21:06:40 -07:00
|
|
|
/// Item in the hand that was deselected.
|
2020-07-06 14:27:03 -07:00
|
|
|
/// </summary>
|
|
|
|
|
public IEntity Item { get; }
|
|
|
|
|
|
2021-05-22 21:06:40 -07:00
|
|
|
public HandDeselectedEvent(IEntity user, IEntity item)
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
User = user;
|
|
|
|
|
Item = item;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|