* Removed obsolete EntitySystemMessage, now everything uses the base EntityEventArgs or the derived HandledEntityEventArgs. Setup InteractionSystem to use new directed events. * Update Submodule.
66 lines
1.8 KiB
C#
66 lines
1.8 KiB
C#
#nullable enable
|
|
using System;
|
|
using Robust.Shared.Analyzers;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Map;
|
|
|
|
namespace Content.Shared.Interfaces.GameObjects.Components
|
|
{
|
|
[RequiresExplicitImplementation]
|
|
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>
|
|
public IEntity? User { get; }
|
|
|
|
/// <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; }
|
|
|
|
public ThrowCollideEventArgs(IEntity? user, IEntity thrown, IEntity target)
|
|
{
|
|
User = user;
|
|
Thrown = thrown;
|
|
Target = target;
|
|
}
|
|
}
|
|
|
|
public class ThrowCollideMessage : HandledEntityEventArgs
|
|
{
|
|
/// <summary>
|
|
/// The entity that threw <see cref="Thrown"/>.
|
|
/// </summary>
|
|
public IEntity? User { get; }
|
|
|
|
/// <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; }
|
|
|
|
public ThrowCollideMessage(IEntity? user, IEntity thrown, IEntity target)
|
|
{
|
|
User = user;
|
|
Thrown = thrown;
|
|
Target = target;
|
|
}
|
|
}
|
|
}
|