2021-03-09 11:22:48 -08:00
|
|
|
#nullable enable
|
2021-02-27 04:12:09 +01:00
|
|
|
using System;
|
2021-01-23 22:45:23 +01:00
|
|
|
using Robust.Shared.Analyzers;
|
2020-09-22 15:34:30 +02:00
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.Map;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Interfaces.GameObjects.Components
|
|
|
|
|
{
|
2021-01-23 20:00:29 +01:00
|
|
|
[RequiresExplicitImplementation]
|
2020-09-22 15:34:30 +02:00
|
|
|
public interface IThrowCollide
|
|
|
|
|
{
|
|
|
|
|
void HitBy(ThrowCollideEventArgs eventArgs) {}
|
|
|
|
|
void DoHit(ThrowCollideEventArgs eventArgs) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class ThrowCollideEventArgs : EventArgs
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The entity that threw <see cref="Thrown"/> and hit <see cref="Target"/>.
|
|
|
|
|
/// </summary>
|
2021-03-08 04:09:59 +11:00
|
|
|
public IEntity? User { get; }
|
2020-09-22 15:34:30 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The entity thrown by <see cref="User"/> that hit <see cref="Target"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEntity Thrown { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The entity hit with <see cref="Thrown"/> by <see cref="User"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEntity Target { get; }
|
|
|
|
|
|
2021-03-08 04:09:59 +11:00
|
|
|
public ThrowCollideEventArgs(IEntity? user, IEntity thrown, IEntity target)
|
2020-09-22 15:34:30 +02:00
|
|
|
{
|
|
|
|
|
User = user;
|
|
|
|
|
Thrown = thrown;
|
|
|
|
|
Target = target;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-09 11:22:48 -08:00
|
|
|
public class ThrowCollideMessage : HandledEntityEventArgs
|
2020-09-22 15:34:30 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The entity that threw <see cref="Thrown"/>.
|
|
|
|
|
/// </summary>
|
2021-03-08 04:09:59 +11:00
|
|
|
public IEntity? User { get; }
|
2020-09-22 15:34:30 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The entity thrown by <see cref="User"/> that hit <see cref="Target"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEntity Thrown { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The entity hit with <see cref="Thrown"/> by <see cref="User"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEntity Target { get; }
|
|
|
|
|
|
2021-03-08 04:09:59 +11:00
|
|
|
public ThrowCollideMessage(IEntity? user, IEntity thrown, IEntity target)
|
2020-09-22 15:34:30 +02:00
|
|
|
{
|
|
|
|
|
User = user;
|
|
|
|
|
Thrown = thrown;
|
|
|
|
|
Target = target;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|