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;
|
|
|
|
|
using Robust.Shared.Map;
|
|
|
|
|
|
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 landing after being thrown.
|
|
|
|
|
/// </summary>
|
2021-01-23 20:00:29 +01:00
|
|
|
[RequiresExplicitImplementation]
|
2020-07-06 14:27:03 -07:00
|
|
|
public interface ILand
|
|
|
|
|
{
|
|
|
|
|
void Land(LandEventArgs eventArgs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class LandEventArgs : EventArgs
|
|
|
|
|
{
|
2021-03-08 04:09:59 +11:00
|
|
|
public LandEventArgs(IEntity? user, EntityCoordinates landingLocation)
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
User = user;
|
|
|
|
|
LandingLocation = landingLocation;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-08 04:09:59 +11:00
|
|
|
public IEntity? User { get; }
|
2020-09-06 16:11:53 +02:00
|
|
|
public EntityCoordinates LandingLocation { get; }
|
2020-07-06 14:27:03 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Raised when an entity that was thrown lands.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[PublicAPI]
|
2021-03-09 11:22:48 -08:00
|
|
|
public class LandMessage : HandledEntityEventArgs
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Entity that threw the item.
|
|
|
|
|
/// </summary>
|
2021-03-08 04:09:59 +11:00
|
|
|
public IEntity? User { get; }
|
2020-07-06 14:27:03 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Item that was thrown.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEntity Thrown { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Location where the item landed.
|
|
|
|
|
/// </summary>
|
2020-09-06 16:11:53 +02:00
|
|
|
public EntityCoordinates LandLocation { get; }
|
2020-07-06 14:27:03 -07:00
|
|
|
|
2021-03-08 04:09:59 +11:00
|
|
|
public LandMessage(IEntity? user, IEntity thrown, EntityCoordinates landLocation)
|
2020-07-06 14:27:03 -07:00
|
|
|
{
|
|
|
|
|
User = user;
|
|
|
|
|
Thrown = thrown;
|
|
|
|
|
LandLocation = landLocation;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|