Files
OldThink/Content.Shared/Throwing/IThrown.cs

51 lines
1.2 KiB
C#
Raw Normal View History

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