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;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Throwing
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This interface gives components behavior when thrown.
|
|
|
|
|
/// </summary>
|
2021-01-23 20:00:29 +01:00
|
|
|
[RequiresExplicitImplementation]
|
2020-07-06 14:27:03 -07:00
|
|
|
public interface IThrown
|
|
|
|
|
{
|
2021-04-29 03:23:15 +10:00
|
|
|
[Obsolete("Use ThrownMessage instead")]
|
2020-07-06 14:27:03 -07:00
|
|
|
void Thrown(ThrownEventArgs eventArgs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class ThrownEventArgs : EventArgs
|
|
|
|
|
{
|
2021-12-04 12:35:33 +01:00
|
|
|
public ThrownEventArgs(EntityUid user)
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
User = user;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-04 12:35:33 +01:00
|
|
|
public EntityUid User { get; }
|
2020-07-06 14:27:03 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Raised when throwing the entity in your hands.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[PublicAPI]
|
2021-05-22 21:06:40 -07:00
|
|
|
public class ThrownEvent : HandledEntityEventArgs
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity that threw the item.
|
|
|
|
|
/// </summary>
|
2021-12-04 12:35:33 +01:00
|
|
|
public EntityUid User { get; }
|
2020-07-06 14:27:03 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Item that was thrown.
|
|
|
|
|
/// </summary>
|
2021-12-04 12:35:33 +01:00
|
|
|
public EntityUid Thrown { get; }
|
2020-07-06 14:27:03 -07:00
|
|
|
|
2021-12-04 12:35:33 +01:00
|
|
|
public ThrownEvent(EntityUid user, EntityUid thrown)
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
User = user;
|
|
|
|
|
Thrown = thrown;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|